Closed ramya-rao-a closed 4 years ago
@gabstv Does this project use Go modules?
From @anjmao on November 30, 2018 22:5
@gabstv I suggest to look at https://github.com/saibing/bingo which already works much better that gocode.
Yes, we are in the process of adding support to bingo as you already know via #2158
Meanwhile, I am moving this issue to the repo for gocode-gomod so that @stamblerre can help.
@gabstv, is this just the result of you triggering completions twice in a row or did anything change between the 2 instances?
@stamblerre It's the result of triggering completions twice (or more until the it gets right) without changing code
Is your project particularly large? This might be related to https://github.com/stamblerre/gocode/issues/20.
The issue seems to be related with go mod. This project I'm in is relatively small.
Edit: gocode works as it should with non "go mod" projects on my end.
@gabstv: sorry I didn't reply earlier. Are you still experiencing this issue? I've not been able to reproduce this, and I haven't heard of anyone experiencing a similar issue, so I'm not sure how to approach this. Does go list -compiled -e -json path/to/project
consistently produce correct output for you / can you post the output here?
I was having the same issue. It almost appeared as though a timeout fires before the contextual list of symbols can be built and I would instead get a generic list of tokens from across my workspace. When I would re-run a second or more time, the contextually correct list of symbols returns before the timeout (though still after an noticeable delay).
This behavior holds regardless of whether I'm trying to get autocomplete on my own code or from external packages. There were also a great many instances of guru
that get spawned whenever I saved a file.
Once I opted out of every option in go.languageServerExperimentalFeatures
except for format
and autoComplete
the number of guru
instances spawned dropped very precipitously and this issue went away.
Closing this issue, as the current recommendation for autocompletion is to use gopls
.
From @gabstv on November 29, 2018 12:25
With the same source code, the intellisense fails to bring relevant results at least 50% of the time.
This happens with the default gocode that VSCode uses.
go version go1.11 darwin/amd64
Run 1 - no suggestions
Run 2 - success
Copied from original issue: Microsoft/vscode-go#2161