Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: suggested completions include many irrelevant, non-deterministic entries #43374

cespare opened this issue Dec 25, 2020 · 0 comments


Copy link

@cespare cespare commented Dec 25, 2020

What version of Go are you using (go version)?

$ go version
go version go1.15.6 linux/amd64

Does this issue reproduce with the latest release?

Yes, and with the current tip of gopls as well.

What operating system and processor architecture are you using (go env)?


What did you do?

I can reproduce this with basically any code.

But concretely, I used this single-file package:

package main

func f(int) {}

func x() {
	n := 3
	m := 4

The | is where my cursor is when I invoked autocompletion.

What did you expect to see?

I expected to see completions that make sense given the types involved. Whatever the completions I saw, I expected that if I invoked autocompletion a second time without making any change whatsoever, I should see the same list of suggestions again.

What did you see instead?

I saw a long list with many irrelevant suggestions. Additionally, every time I invoked autocompletion, the list was different.

I noticed this in my usual environment (vim + govim) but I can reproduce with vscode as well. Here are some screenshots (I pressed ctrl-space three times in a row and got these three results):




Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.