-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: applied suggested fix in go.mod doesn't remove diagnostic #44439
Comments
Thanks for the report, but I'm actually not able to reproduce this in VS Code. Can you please share a log with the "verboseOutput" setting enabled? |
Sure! I think the key point is that Log:
|
Oh sorry, I totally missed this part. This is working as intended--you do need to save the file to resolve the diagnostic. This is a decision we've made in |
That totally make sense! From a user perspective this is a slightly different case than typing, as the user is applying a suggested fix (from another file, in this case Other suggested fixes applied makes the suggested fix go away while this sticks around until you realise that you have to switch to |
That's fair, but it would be tricky to get right on the |
I think it'd make sense to force a metadata load after a quick fix finishes. As long as the didChange always comes in before applyEdit returns, which seems like the most reasonable client implementation, I don't think it's particularly racy or difficult. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
With the following scenario:
I open both
go.mod
andmain.go
(so that applying suggested fixes togo.mod
are sent asworkspace/applyEdit
).Then I choose to apply the suggested edit
go get rsc.io/quote
for the "BrokenImport" diagnostic.What did you expect to see?
The diagnostic removed directly (the same way applying fixes to a
.go
file does).What did you see instead?
The diagnostic is still there.
Applying the suggested fix makes
gopls
to sendworkspace/applyEdit
back that updatesgo.mod
into an unsaved state.I also noticed that
gopls
creates ago.sum
file on the file system.Saving
go.mod
do make the diagnostic go away.gopls.log:
The text was updated successfully, but these errors were encountered: