x/tools/gopls: incorrect metadata invalidation when changing package name #52500
Labels
FrozenDueToAge
gopls/metadata
Issues related to metadata loading in gopls
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Gopls doesn't correctly invalidate package data when moving a file to a new package:
https://cs.opensource.google/go/x/tools/+/master:internal/lsp/cache/snapshot.go;l=1842;drc=37590b385d564de6d3b0aedae2b5821b3f357d1d
As a result, it's pretty easy to break gopls' metadata by toggling package names. Repro: move a file from
package x_test
topackage x
, wait a second, then move it back topackage x_test
: the resulting file will not be contained in any package...Filing this issue to track the fix, and to associate with the new gopls/metadata label.
The text was updated successfully, but these errors were encountered: