x/tools/gopls: changing environment variables can cause gopls to forget file content #57934
Labels
FrozenDueToAge
gopls/file-corruption
Issues related to file corruption in gopls
gopls
Issues related to the Go language server, gopls.
NeedsFix
The path to resolution is known, but the work has not been done.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Just noticed that gopls' internal view of the filesystem relies on seeing every change since the LSP session started (see also #57558).
But this breaks if we reinitialize state following a major change to settings. This can cause gopls to get confused about the content of open files. I have reproduced in a test, and have a fix.
I think this has been the behavior since ~always, and may be a cause of users reporting having to restart gopls following configuration changes in VS Code.
The text was updated successfully, but these errors were encountered: