Autocomplete+ (autocomplete without hotkey)


#1

Hey,

today I created a custom autocompletion package that supports completion while typing (without a hotkey). I also added some performance tweaks that make it pretty fast and nice.

Looking forward to your feedback! :smile:

Best,
Sascha


Tab Completion for Faster Coding!
Show AutoComplete suggestions while typing w/o ctrl + space
TernJS plugin development
#2

“This package added 451ms to startup time” :dizzy_face:


#3

Thanks for your work. It works pretty good.


#4

Works well but I share ohm’s concern regarding the startup time.


#5

Awesome job. This is great.


#6

Startup time depends on the settings and the file that is initially open since the package builds a word list on startup. Also, since the package is activated whenever a new editor window is opened, the initial startup time gets larger. That speeds up the usage while typing though.


#7

It would be nice to implement the selected completion on tab rather than enter.


#8

Good idea, I’ll put it on the list and try it out. :smile:


#9

Fantastic plugin! I feel like this plugin should bash over the existing one :stuck_out_tongue:


#10

I currently have both installed and they’re coexisting nicely. I can imagine a need for both on different machines, though. For example, at home a have a nice new machine that runs Atom snappy fast … this package works great and is worth the extra overhead of always popping up the alternates and generating new word lists, etc.

At work I have a rather obsolete and underpowered MacBook Pro … where Atom runs pretty well, but sometimes there are noticeable delays in syntax highlighting. On that machine I might want to use the regular Autocomplete package to keep things as fast as possible.


#11

I agree. It would be pretty easy to add the original keyboard shortcut as an option, though.


#12

I’ve been using this in a production workflow, and its getting dicey in stylesheets. Perhaps create a file type exclusion setting?


#13

I’m trying to think of a way I can use this in my project. i.e. extend your class implement my own buildWord list, onReturn etc… I’m currently doing that with the existing AutoComplete view but yours is so much more usable and compleye.

Do you know of any issues I might have if I extended your class?

The folks who are making ternjs for atom would most likely want to use yours as well.
https://github.com/mattapperson/atom-ternjs/


#14

Dicey meaning annoying or slow? Yeah file type exclusion is a good idea. Adding it to the list, probably pushing out a new release tonight!


#15

I’m subclassing atom’s SelectListView in a pretty dirty way. Since the default class is using a mini EditorView, I had to re-implement some methods myself so that they don’t try to reference the editorView anymore. But it’s still pretty straight forward. I might refactor it so that it subclasses View instead of SelectListView though - that would clean it up a little.

If you have any questions on the implementation, drop me a mail: sascha@gehlich.us


#16

Thanks I’ll do that.

I really feel like there should be 1 global autocomplete running that other packages could subscribe to buildWordList that way other people could include their own completions.
2 use cases for this already:

  1. For specific auto completions like DocBloc definitions, you don’t need these everywhere but in the right context you do (inside a doc block).
  2. TernJs, they run a v8 in the background and can give you suggestions outside the scope of your project (i.e. they surface the entire DOM API. wow)

The contract would look like this: every keychange or input you would call BuildWordList and give all your subscribers the prefix, they would all respond with their list. and on enter select of that item, you would call the subscribers callback with the selected item.

Side Note I’m creating a port of DocBlockr and this would be very useful. Same with the TernJS folks.

Side Side Note: this is an opportunity for your package to be the base of every package that wants to subscribe to auto complete :wink:


#17

I see what you mean, that’s a good idea and it should be possible with the current architecture of autocomplete+.

I’m working on a DocBlockr port as well, mind sharing your progress? :slight_smile:


#18

Yeah lets take this conversation out of this thread though :wink: ill send you an email


#19

@kenwheeler I added blacklisting and tab for selection with version 0.5.0!


#20

Awesome! Re: Diceyness, I was editing numerical values in a sass file and it was triggered. Perhaps making sure the buffer content prior to the period is [A-z] before triggering would solve that.