Repository navigation
Clear pull state when a document diagnostic pull fails - #1899
Merged
Dirk Bäumer (dbaeumer) merged 2 commits intoOct 21, 2026
Merged
Dirk Bäumer (dbaeumer) merged 2 commits into
Dirk Bäumer (dbaeumer) merged 2 commits into
Conversation
pullAsync rethrew non-cancellation errors before removing the request from openRequests. Later pulls for that document then saw an active request, so they only marked it for rescheduling and never sent a new request. The document was never pulled again for the rest of the session. A server cancellation with retriggerRequest: false was also rethrown. The outDated check set afterState, so the check that followed it fell through to `throw error`. Make the checks an if/else-if chain so that case takes the existing outDated path instead.
There was a problem hiding this comment.
🟢 Approval recommended
The focused fixes address both reported failures, with regression coverage and no unresolved findings.
No open issues 🎉
What changed in this PR
Fixes #1898 by allowing document diagnostic pulls to recover after failures instead of remaining blocked for the session.
Changes:
- Clears stale request state before rethrowing non-cancellation errors.
- Handles server cancellation without retriggering as an outdated request.
- Adds regression tests for subsequent pulls and expected error logging.
| File | Description |
|---|---|
| client/src/common/diagnostic.ts | Fixes failed-request cleanup and cancellation handling. |
| client-node-tests/src/integration.test.ts | Tests recovery after errors and server cancellation. |
Review effort: Balanced
Dirk Bäumer (dbaeumer)
approved these changes
Oct 20, 2026
Anthony Kim (anthonykim1)
approved these changes
Oct 20, 2026
roblourens
approved these changes
Oct 20, 2026
Dirk Bäumer (dbaeumer)
enabled auto-merge (squash)
October 21, 2026 06:29
Trivikram Kamat (trivikr)
deleted the
client-diagnostic-non-cancellation-error
branch
October 21, 2026 06:52
This was referenced Oct 29, 2026
David Wilson (daviwil)
added a commit
to daviwil/vscode-swift
that referenced
this pull request
Oct 30, 2026
vscode-languageclient 11 includes microsoft/vscode-languageserver-node#1899, so a failed diagnostic pull no longer stops later pulls for the document. Remove the middleware that worked around it. It requires VS Code 1.91, so raise engines.vscode and @types/vscode to match. Migration changes: - The package now has an exports map, so the deep imports go. The workspace folders feature is recognized by its registration method, and the test explorer test imports the protocol converter from the $test entry point, which also takes the new supportThemeIcons argument. - The client's output channel must be a LogOutputChannel, and the client only traces the server when the channel's log level is Trace. Wrap the SourceKit output channel so it keeps its log file and message format, and report Trace while swift.sourcekit-lsp.trace.server isn't off.
Matthew Bastien (matthewbastien)
pushed a commit
to swiftlang/vscode-swift
that referenced
this pull request
Nov 5, 2026
* Add the PR number to the CHANGELOG entry * Update vscode-languageclient to 11.0.0 vscode-languageclient 11 includes microsoft/vscode-languageserver-node#1899, so a failed diagnostic pull no longer stops later pulls for the document. Remove the middleware that worked around it. It requires VS Code 1.91, so raise engines.vscode and @types/vscode to match. Migration changes: - The package now has an exports map, so the deep imports go. The workspace folders feature is recognized by its registration method, and the test explorer test imports the protocol converter from the $test entry point, which also takes the new supportThemeIcons argument. - The client's output channel must be a LogOutputChannel, and the client only traces the server when the channel's log level is Trace. Wrap the SourceKit output channel so it keeps its log file and message format, and report Trace while swift.sourcekit-lsp.trace.server isn't off. * Fix the type and lint errors from the vscode-languageclient update vscode-languageserver-protocol 3.18's DocumentSelector isn't assignable to VS Code's, so the document selectors keep their own type, which fits both. Use the extension's Disposable type, and don't call the deprecated OutputChannel.show overload. Update package-lock.json.
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.
Fixes: #1898
When a document diagnostic pull failed, the client never pulled that document again for the rest of the session.
pullAsyncnow removes theopenRequestsentry before rethrowing a non-cancellation error. Before, the staleactiveentry made every later pull look like it was already in flight, so no new request was sent.retriggerRequest: falsenow takes the existingoutDatedpath. Before, it fell through tothrow error, so it was logged as "Document pull failed" and left the document stuck the same way.Adds two integration tests. Each makes one pull fail through
provideDiagnosticsmiddleware and checks that the next pull still reaches the provider.