gocode icon indicating copy to clipboard operation
gocode copied to clipboard

Company: make autocomplete after typing "func" optional

Open ghost opened this issue 8 years ago • 6 comments

As it is right now, with a default company-minimum-prefix-length company-go will popup function names after you type func and selecting them replaces the previously written func. This is pretty strange behaviour, and no other autocompletion I've used would open up a list of candidates after typing function or whatever the language's keyword for it is.

Are there any plans of adding something like this? If not that's fine, I'm okay with patching it myself. It seems simple enough from the emacs side, but if this was added to the core gocode is beyond my capability. But there's a few places I could put this, and I'm not sure where is best. Any pointers would be appreciated.

ghost avatar Jan 07 '18 05:01 ghost

I can make a flag which disables that feature on the gocode side.

nsf avatar Jan 07 '18 08:01 nsf

Added in https://github.com/nsf/gocode/commit/416643789f088aa5077f667cecde7f966131f6be. The option is enabled by default to keep backwards compatibility. Try disabling it, maybe it solves your problem.

nsf avatar Jan 07 '18 08:01 nsf

Yes, that fixed it. Thank you so much!

ghost avatar Jan 07 '18 20:01 ghost

This also happens when typing "break", it will open up completion for everything that's defined. Is that intended?

ghost avatar Jan 10 '18 22:01 ghost

No it's a bug. https://github.com/nsf/gocode/issues/385

nsf avatar Jan 11 '18 06:01 nsf

I am learning Go recently and meet the problem. I am still confused about what I should do to fix it, can anybody tell me?

Dicridon avatar Feb 13 '18 02:02 Dicridon