x/tools/gopls: track saved go.{mod,sum} files in the workspace #43305
Labels
FrozenDueToAge
gopls/workspace
Issues related to support for modules or multi-module workspaces.
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 currently invalidates package metadata on any change to a go.mod file. This can lead to a poor experience editing go.mod files by hand, as described in #42529. Fixing #42815 could make this the case for go.sum files as well (though editing go.sum files by hand is not advisable).
We're going to mitigate some of the pain by only invalidating metadata when a go.mod or go.sum is saved. However, this can lead to some confusing edge cases, such as the
go mod why
hover text referencing a module layout that is inconsistent with the loaded metadata.On balance these confusing edge cases are likely to be rare and less severe than the current problems editing go.mod files, so we'll proceed with this fix. Longer term, we should change the logic of the
workspace
to only track saved files, so that features can cleanly operate on just the saved mod/sum files by using theworkspace
, and can access overlaid content by using thesnapshot
.CC @stamblerre @heschik
The text was updated successfully, but these errors were encountered: