x/tools/gopls: track saved go.{mod,sum} files in the workspace #43305
Milestone
Comments
Another complication here is correctly handling didChangeWatchedFIles notifications when the file change is on disk and the buffer is open and modified. Currently when the event gets to snapshot.clone, we only have the overlay. We need to pass the on-disk file handle as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: