You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A language server that is switched off starts again when a feature asks it for its language server #2036
LanguageServerWrapper.start() starts a language server that is switched off: it returns early only for one that is disposed. getInitializedServer() calls start(), and a feature that still holds a language server calls getInitializedServer() after the language server is switched off, as LSPLazyCodeActions.loadCodeActionsFor does for the quick fixes of the diagnostics that the language server showed. So:
a language server that is switched off, by stopAndDisable(), by a stop of its definition or of its instance, or by too many failed starts, starts again as soon as such a feature asks it for its language server, and runs while switched off. Once the window of the failed starts has passed, this also starts again a language server that too many failed starts switched off;
when that happens while its stop runs, the stop never ends as stopped: stop() sets that status only if no start replaced its attempt meanwhile, so the language server stays stopping, and then started once the new start is done.
LanguageServerManager, restart() and Enable and Start switch a language server on before they start it, so only these starts by a feature are concerned. connect() already drops a connection whose attempt a stop replaced (#1867).
How it showed
LanguageServerManagerInstancesTest.testEnableAndStartOfAnInstanceWhichFailedStartsDisabledStartsNoOtherStoppedInstance failed once, on IntelliJ 2026.3 (the CI of #2033): after a.stopAndDisable(), the instance a wasn't stopped after a minute. The mock language server got textDocument/codeAction requests after the stop, from the quick fixes of the diagnostic that a showed.
Reproduction
a.stopAndDisable();
a.getInitializedServer(); // starts a again: a is never stopped
or, once a is stopped, a.getInitializedServer() starts it again while it is switched off.
Activity
fix: start no language server that is switched off for a feature that…