Repository navigation
fix: pull workspace diagnostics again when the server cancels a pull itself - #2029
Merged
lagergren merged 1 commit intoNov 20, 2026
Conversation
…itself Fixes redhat-developer#2027 LSP4J answers RequestCancelled for any request whose future a server cancels, so an LSP4J server cannot answer ServerCancelled for a pull it cancels itself. A pull that LSP4IJ cancels completes at once with a CancellationException, so a RequestCancelled answer always comes from the server: it now triggers a new pull, as ServerCancelled does. Other errors still stop the pulls until the next refresh.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2029 +/- ##
==========================================
- Coverage 49.17% 49.16% -0.02%
==========================================
Files 813 813
Lines 33095 33098 +3
Branches 6771 5129 -1642
==========================================
- Hits 16276 16271 -5
- Misses 14275 14278 +3
- Partials 2544 2549 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 #2027
LSP4J answers
RequestCancelledfor any request whose future a server cancels, so a server built on LSP4J cannot answerServerCancelledfor a workspace pull it cancels itself.WorkspaceDiagnosticManagertook that answer as a failure and stopped pulling until the next refresh.A pull that LSP4IJ cancels completes at once with a
CancellationException, and a late answer to it is ignored, so aRequestCancelledanswer that reachesshouldRetriggercomes from the server. It now starts a new pull, asServerCancelledwithout data does. Other errors still stop the pulls until the next refresh or registration.Tests
WorkspaceDiagnosticManagerTest:retriesAPullTheServerCancelledItself: after aRequestCancelledanswer, the next pull comes, with the previous result IDs. It fails without the fix.stopsAfterAFailedPull: anInternalErrorstill stops the pulls until a refresh.The diagnostic tests (
--tests '*Diagnostic*'): 83 tests, 0 failures.