Repository navigation
fix: forget diagnostic result IDs when clearing diagnostics for a URI - #3070
Merged
Merged
Conversation
When a view for a file outside of the workspace folders is closed, its pull diagnostics are cleared but the stored result ID was kept. On reopen the request carried that previousResultId, the server could reply with an unchanged report, and no diagnostics were shown. Assisted-By: Claude Code:claude-opus-5-5
Member
Author
|
I admit I never had good understanding of the whole diagnostics logic so I'm relying mainly on AI here doing good job (and @jwortmann's reviewing) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a view of a file outside of the workspace folders is closed,
SessionBuffer._on_before_destroyclears the pull diagnostics stored for its URI, but the result ID from the lasttextDocument/diagnosticresponse was kept inSession.diagnostics_result_ids.When the file is opened again, the request carries that
previousResultId. The server can then reply with an unchanged report, which reuses the stored diagnostics, but those were already cleared, so no diagnostics are shown until the file changes.Session.clear_diagnostics_for_urinow also drops the result IDs for that URI, so the next request gets a full report.This also seems to be the cause of the intermittent
UvTestsuite.test_diagnostics(LSP-ruff) timeouts in lsp_utils CI, e.g. https://github.com/sublimelsp/lsp_utils/actions/runs/38169487011. The test closes and reopens the test file, and it fails whenever the first pull diagnostics response arrives before the close.Assisted-By: Claude Code:claude-opus-5-5