Skip to content
This repository has been archived by the owner on May 23, 2018. It is now read-only.

typing return offers many autocomplete suggestions, but not return #27

Open
crantok opened this issue May 18, 2016 · 4 comments
Open

typing return offers many autocomplete suggestions, but not return #27

crantok opened this issue May 18, 2016 · 4 comments

Comments

@crantok
Copy link

crantok commented May 18, 2016

  • On typing retur in a function, I am offered no autocomplete suggestions. I am okay with this.
  • On typing return in a function, I am offered many autocomplete suggestions. Many of them do not contain all the letters r, e, t, u, r, and n. None of them are return. I am not okay with this because (unless I am actually going to return something) I have to interrupt normal typing to dismiss the suggestions.

Steps to Reproduce

  1. Ensure you are in a project where 'retur' would not form part of an autocomplete suggestion.
  2. Within a function, in a Go file, on a clean line, type retur.
  3. Type n.

Expected Behavior

To see return in the list of autocomplete suggestions

Actual Behavior

I see lots of other things instead.

@sprt
Copy link

sprt commented Jun 6, 2016

Same for if, range, defer and the likes.

@joefitzgerald
Copy link
Owner

@crantok autocomplete-plus has multiple providers; autocomplete-go is not the only one. Each provider (including ac+'s bulit-in provider) can provide their own suggestions. To have gocode return suggestions for builtins, run gocode set propose-builtins true.

@lloiser
Copy link

lloiser commented Sep 1, 2016

The setting Suppress The Provider Built-In To autocomplete-plus also affects the suggestions you see. autocomplete-plus by default provides suggestions based on words in other files. Check the mentioned setting if you only want to see suggestions provided by gocode (so actually related to your code) and ignore the rest.

@crantok
Copy link
Author

crantok commented Sep 2, 2016

All the suggestions I see having typed return are provided by autocomplete-go.

Additionally, if I use arrow keys to select and accept one of those suggestions, it is appended to return without a space, so I get something like returnMyVar.

I've just checked my autocomplete-go settings and they are suppressing the built-in provider. I had a look in config.cson and there is no entry for autocomplete-go, so I assume that I'm using the default settings.

I am using autocomplete-go version 1.1.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants