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: unimported completions not (consistently) offered #38764
Comments
I can't reproduce this. There should be a total of 5 completion results (https://cs.opensource.google/go/tools/+/master:internal/lsp/source/completion.go;drc=8463f397d07cfd2b3f1442fb1daa5e6bc2178a6e;l=743) arbitrarily chosen from any packages that match the prefix. I often see the cue parser package. |
I can reproduce this consistently locally. Is there anything I can do to help debug?
I think we should improve this logic to prefer those packages in modules "closest" to the |
Ranking is #38104. Actually, I'm confused. I just looked at your log, and I see |
Ah, I see what's happening here. This is actually my expectations being wrong because of the random results. Apologies. Is there any way we can increase the limit from 5? Where does that limit come from? |
It's totally arbitrary, so of course it can be increased. See the description of https://golang.org/cl/218879 for more details. It may be that people are more willing to scroll through a list of completions than we expected, but I still generally think you should just keep typing? |
What if, as is the case here, you have > 5 packages called Or did I miss your point? |
You could type Feel free to send a CL to increase the 5, but you're probably going to have to explain why you're confident that there won't be 10 (or however many) |
Doesn't that only work if you have deep completions turned on? |
Turns this works without deep completions. So I think the only open question is whether we want to make the logic around returning 5 random results for the |
Not without a compelling rationale. Closing. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
These steps are reduced from a more complex example:
Then attempt completion after
par
in themain.go
fileWhat did you expect to see?
Offered completion candidates for:
What did you see instead?
During repeated calls to completion, most of the time I only saw:
Sometimes:
But the
cuelang.org/go/cue/parser
package was never a candidate.See the attached log file for the sequence of events: gopls_20200430_1402_02_716145697.log
cc @stamblerre @heschik
FYI @leitzler
The text was updated successfully, but these errors were encountered: