Autocomplete problem when variable name is just once character


#1

Hi here.

I am using Atom mostly for programming in GoLang. I have experienced the following misbehavior already a while ago but it’s becoming more and more annoying therefore I’d like to document it here.

In Go it is quite common to use variables of just single char name, like r for *http.Request (as seen also in my gif) or w for http.ResponseWriter, etc. Once you use the autocompletion (for Go provided by autocomplete-go package) and provide a single char variable r as a parameter, the autocompletion is triggered providing also some handy code templates (never used them and the fact they are displayed before more important variables and code structures is a subject to file different feature request to the autocomplete-go package) as well as my r variable. After selecting it (mouse click or arrow keys on the keyboard) and hitting Enter or Tab the autocompletion is triggered again not allowing me to move on another parameter in the function.

See on recorder screen below:

The blinking of the autocompletion list is caused by hitting Enter or Tab.

If this would work fine (i.e. after selecting a single char value from the list autocompletion is not triggered again) I could use Tab to move immediately on the next function parameter.

Just for an imagination, this is correct behavior when a variable has at least 2 characters in name:


#2

It appears that the difference between the two scenarios is that in the first case, the completion is identical to the prefix: when you type r and press Tab, it inserts r. autocomplete-plus then takes a look at the text before the cursor and sees a potential prefix and opens again. In the second case, you type re and press Tab, and it inserts req, which is different than what you typed. autocomplete-plus then takes a look at the text before the cursor and sees a completion and gets out of the way. I believe preventing this kind of scenario is what the “Minimum Word Length” setting is for. Did you change that setting in the autocomplete-plus configuration? Or is the autocomplete provider for Go ignoring it?