x/tools/go/packages: new packages in overlays don't work for modules #33482
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Forked from #31467.
This is only applicable to modules, as it works fine in
$GOPATH
mode.To reproduce, create a directory
foo
outside of your$GOPATH
.Open
foo
in VSCode (usinggopls
), then create filefoo.go
, but do not save it.Add some code like
gopls
will not provide autocompletion for this file becausego/packages
will not return a valid package. The reason for this is that there are norootDirs
in this case: https://github.com/golang/tools/blob/c5a2fd39b72a2403dae32d544b008ff4973c8b29/go/packages/golist_overlay.go#L78, so thepkgPath
will never be set./cc @matloob
The text was updated successfully, but these errors were encountered: