-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Regression: Diagnostics not clearing after fix and save #17300
Comments
Was just about to file this. For me, this is only happening over SSH. |
Looking at this, what I just noticed could cause this is if the next flycheck gets cancelled, the diagnostics are not cleared. But I don't think that should happen too often so probably not the issue? I'll try to look if I can replicate it (maybe with ssh), but does it happen for you with all projects? Or just some specific ones? |
I also encountered this issue. The problem started after upgrading to the latest version of rust-analyzer yesterday afternoon. I encountered this issue on both VSCode and Zed. |
It might be because your local and remote environments are using different versions of the rust-analyzer extension. Once you upgrade them to the latest version, you will encounter the same issue. |
I'm having the exact same issue on my local vscode. Errors don't seem to get cleared after fixing the code. (just to confirm, I downgraded to v0.3.1958 and all is well) |
Right, I can tell the issue. If you have check on save diagnostics somewhere and the next check succeeds without emitting any again we won't clear them as the logic only does when a diagnostic was received 🤦 |
Right, it's in fact the other way around, we don't clear it if a succeeding check still has diagnostics (that is we accumulate), which is what one can observein the linked example video (the |
If a check has diagnostics, the old ones should be cleared when the first The state is tracked for flychecks globally though, so if there are invocations per workspace, that would be broken as the first finishing flycheck would clear its (potentially empty) diagnostics and the other flychecks would accumulate. |
temporary fix for zed: |
Note that rust-analyzer is not installed by rustup when you use the default profile, you need to add the component manually if you haven't yet. |
fix diagnostics clearing when flychecks run per-workspace This might be causing #17300 or it's a different bug with the same functionality. I wonder if the decision to clear diagnostics should stay in the main loop or maybe the flycheck itself should track it and tell the mainloop? I have used a hash map but we could just as well use a vector since the IDs are `usizes` in some given range starting at 0. It would be probably faster but this just felt a bit cleaner and it allows us to change the ID to newtype later and we can just use a hasher that returns the underlying integer.
Fixed in #17302. |
This is suddenly happening to me again in the pre-release version |
Looking at recently merged PRs, it looks like #18729 might be causing it. |
I think I've observed it as well earlier. Will investigate a bit and otherwise revert for now. |
I am experiencing this behavior in release version 0.3.2247 and 0.3.2249, but not in 0.3.2237. |
i am experiencing this too. using 0.3.2249 in vscode |
also experiencing this on 0.3.2249 |
Also running into this on 0.3.2249 |
I used the pre-release version of rust-analyzer and it's as simple as that. 0.4.2250 |
This seems to be a regression from the last released version of the rust-analyzer extension. When the file is saved, diagnostics will appear, but then if problem is fixed and saved again, the diagnostics will remain. The extension must be restarted to clear diagnostics.
This only occurs on the newest version of rust-analyzer. When testing on 0.3.1958, this issue does not occur. I suspect it has something to do with this PR.
rust-analyzer version: 2024-05-27
rustc version: rustc 1.80.0-nightly (bdbbb6c6a 2024-05-26)
editor or extension: VSCode, extension version 0.3.1975
example video of issue:
https://github.com/rust-lang/rust-analyzer/assets/1285308/9dee3798-cddd-4e76-9a11-e49cfd510cca
The text was updated successfully, but these errors were encountered: