Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Autocomplete pops up when you complete a string literal #389

Closed
prencher opened this issue Jul 12, 2016 · 5 comments
Closed

Autocomplete pops up when you complete a string literal #389

prencher opened this issue Jul 12, 2016 · 5 comments

Comments

@prencher
Copy link

If I type "foo", when I type the last ", whether it was there already or not, the autocomplete pops up for no apparent reason, leading to an autocomplete for append if enter is hit.

This manifests in particular with switches function calls, and struct initializations, as the autocomplete stays up even when you type : and ,.

For example:

switch test {
case "foo": // At this point, if you hit enter, it'll put in `append` rather than a newline.
@jblachly
Copy link

I opened this same issue with gocode:

nsf/gocode#367

This is particularly problematic when completing a string, because one's instinct is to end the string with " then quickly hit enter. However, you will be treated to the autocomplete suggestion append (alphabetically first in the list of irrelevant suggestions)

I am shocked to know this has been going on for so long. Does everyone else just reach up and hit the escape key with their pinky after completing every string literal?

@jblachly
Copy link

As an update, I note the original filer's complaint that autocomplete stays up after typing : and , seems to be resolved.

However, the end-of-line string literal autocomplete problem remains.
If this won't be fixed in gocode, it would be great if vscode-go can handle this case as well.

gocode's author's comment regarding this was:

If editor triggers completion at weird location it's a problem of an editor. Gocode has no semantics of "valid completion point".

@zackslash
Copy link

This issue has become more prominent with the inclusion of the 'auto complete unimported Packages' feature, since typing out a string can now lead to unnecessary imported packages.
I've tested this scenario in IntelliJ and no auto complete dialogues are shown while editing a string.

@ramya-rao-a
Copy link
Contributor

#586 will fix this

@ramya-rao-a
Copy link
Contributor

The latest update (0.6.48) has the fix.
Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 2018
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