x/tools/gopls: completion stops working when using labels #46650
Labels
gopls/parsing
Issues related to parsing / poor parser recovery.
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
In this (slightly contrived for demonstration purposes, but real-world) example
gopls
completion breaks:Trying to get completion on
v
at any point before thesw:
results in a list of all completions as if completion had been initiated without typing anything (i.e. a list of packages, types, builtins, variables in scope, etc.)It does work at any point after the label though: before, inside, and after the
switch
.At first I thought it might be related to the overriding of the
v
variable, but it seems not; here is an even smaller (and more contrived) example:Completion doesn't work if you try to add something after the assignment to
t
, but does work after the label.First observed with gopls v0.6.3, I updated to v0.6.11 and this didn't fix it, I tried the latest master (commit 4e58f8f) and this didn't fix it either. I seem to recall this worked before (0.4 or 0.2) as I use this pattern more often, but I could be 100% misremembering this and didn't verify, so don't put too much stock in that.
I normally use Vim with vim-lsc; I installed VSCode just to be sure it's not a vim-lsc problem and the behaviour there is identical, so it seems a gopls issue. The project and test case are properly set up (i.e. it has a go.mod) and everything else works fine.
Version details, screenshot, sent and received messages
The text was updated successfully, but these errors were encountered: