Repository navigation
fix: a language server that reports a progress no longer hangs in a headless application - #2344
Merged
Conversation
…eadless application LSPProgressManager started the task of a progress with ProgressManager.run(Task.Backgroundable) in the thread that notifies it, which reads the messages of the language server. In a headless application, as in the tests of a plugin built on LSP4IJ or a headless run of the IDE, the platform runs a background task in the thread that starts it, so that thread looped on the progress and read no further message, its end included: every request to the language server waited forever. The task is now started from a pooled thread. With a UI, it ran in the background already. Fixes redhat-developer#2342
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2344 +/- ##
==========================================
+ Coverage 58.64% 58.84% +0.19%
==========================================
Files 849 849
Lines 36719 36720 +1
Branches 7609 7609
==========================================
+ Hits 21535 21608 +73
+ Misses 12186 12098 -88
- Partials 2998 3014 +16 ☔ 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 #2342, for 0.30.3.
Behaviour change
$/progresstask now starts on a pooled thread, not on the thread that reads the language server's messages. In a headless application, such as the tests of a plugin built on LSP4IJ or a headless run of the IDE, the platform used to run the task in the reading thread. That thread then read no further message, so every request waited forever. With a UI, the task already ran in the background, so the IDE behaves as before.Tests
ProgressInHeadlessModeTest: the mock language server reports a progress, then the client asks for a hover, and the answer must arrive within 10 s. Againstmainit fails, because the answer is never read.$/progress, pass.LSPProgressManager.Not checked