x/tools/gopls: suggests completion 'nilfunc' instead of 'nil' when module requires golang.org/x/tools #42097
Labels
FrozenDueToAge
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.
Steps to reproduce
Now move the cursor to the function body, type
return nil
, leave the cursor at the end of that line, and wait for completions.Expected
nil
is the obvious thing to return from afunc interface{}
, and is also a valid and complete statement, so no completion should be suggested (or the first completion should benil
itself).Observed
The first completion returned by
gopls
is the package namenilfunc
for packagegolang.org/x/tools/go/analysis/passes/nilfunc
, so any stray press of theTab
key will result in a broken source file. 😞CC @stamblerre @heschik
The text was updated successfully, but these errors were encountered: