Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: deep completions for types in structs show non-type items #34412
What did you do?
What did you expect to see?
A list of completions of types as I typed
What did you see instead?
The first two are normal completions, and make sense. The last three are deep completions, but only the first is actually a type.
Thanks for noticing this. Coincidentally I was just working on a fix to prefer type names in this situations. Let me push it.
Note that even with my change it is still possible to get non-type completion items. Even if we expect a type name, we don't exclude non-type items, so they can still show up.
Are there any situations where completions that don't look like
Yes, I think you are right. As long as we are 100% confident a type name is required, we can exclude non-type candidates.
That is definitely true also. If things are sorted properly there isn't much of a downside to including more candidates. We'll eventually be smarter about this.
Please give my CL a try and see if it makes a difference. You might need the first CL in the series as well to merge cleanly.