Repository navigation
fix: start no language server that is switched off for a feature that still holds it - #2037
Merged
lagergren merged 1 commit intoNov 20, 2026
Conversation
… still holds it Fixes redhat-developer#2036. `LanguageServerWrapper.start()` returned early only for a disposed language server, so `getInitializedServer()` started a language server that is switched off for a feature that still holds it, as the quick fixes of the diagnostics that it showed do (`LSPLazyCodeActions`). Such a language server ran while switched off, and when it started while its stop ran, the stop never ended as `stopped`: it sets that status only if no start replaced its attempt meanwhile. `start()` now starts nothing while the language server is switched off, as for one that is disposed: `getInitializedServer()` and `connect()` then give no language server, as they do for one that cannot start. `LanguageServerManager`, `restart()` and *Enable and Start* switch a language server on before they start it. Test: `LanguageServerManagerInstancesTest.testAFeatureThatStillHoldsAnInstanceSwitchedOffDoesNotStartIt` asks an instance for its language server while `stopAndDisable()` stops it and once it is stopped: it gets none, and the instance stays stopped and switched off. Without the change, the instance is never stopped, as in the CI failure of `testEnableAndStartOfAnInstanceWhichFailedStartsDisabledStartsNoOtherStoppedInstance` that found it. All tests pass (1763, 7 skipped, as on `main`).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2037 +/- ##
=========================================
Coverage 49.43% 49.44%
=========================================
Files 813 813
Lines 33324 33324
Branches 6848 5191 -1657
=========================================
+ Hits 16473 16476 +3
- Misses 14278 14280 +2
+ Partials 2573 2568 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@coderabbitai review |
Action performed
|
This was referenced Nov 24, 2026
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 #2036.
LanguageServerWrapper.start()returned early only for a disposedlanguage server, so
getInitializedServer()started a language serverthat is switched off for a feature that still holds it, as the quick
fixes of the diagnostics that it showed do (
LSPLazyCodeActions). Such alanguage server ran while switched off, and when it started while its
stop ran, the stop never ended as
stopped: it sets that status only ifno start replaced its attempt meanwhile.
start()now starts nothing while the language server is switched off,as for one that is disposed:
getInitializedServer()andconnect()then give no language server, as they do for one that cannot start.
LanguageServerManager,restart()and Enable and Start switch alanguage server on before they start it.
Test:
LanguageServerManagerInstancesTest.testAFeatureThatStillHoldsAnInstanceSwitchedOffDoesNotStartItasks an instance for its language server while
stopAndDisable()stopsit and once it is stopped: it gets none, and the instance stays stopped
and switched off. Without the change, the instance is never stopped, as
in the CI failure of
testEnableAndStartOfAnInstanceWhichFailedStartsDisabledStartsNoOtherStoppedInstancethat found it. All tests pass (1763, 7 skipped, as on
main).