Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: track saved go.{mod,sum} files in the workspace #43305

Closed
findleyr opened this issue Dec 21, 2020 · 2 comments
Closed

x/tools/gopls: track saved go.{mod,sum} files in the workspace #43305

findleyr opened this issue Dec 21, 2020 · 2 comments
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.

Comments

@findleyr
Copy link
Contributor

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 the workspace, and can access overlaid content by using the snapshot.

CC @stamblerre @heschik

@findleyr findleyr added this to the gopls/v0.6.2 milestone Dec 21, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Dec 21, 2020
@findleyr findleyr modified the milestones: gopls/v0.6.2, gopls/v1.0.0 Dec 21, 2020
@findleyr
Copy link
Contributor Author

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.

@stamblerre stamblerre added this to To Do in gopls on-deck Feb 28, 2021
@findleyr findleyr added the gopls/workspace Issues related to support for modules or multi-module workspaces. label Aug 14, 2022
@findleyr
Copy link
Contributor Author

Circling back, I don't think this is necessary given native overlay support.

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2022
@golang golang locked and limited conversation to collaborators Aug 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
No open projects
Development

No branches or pull requests

2 participants