Repository navigation
fix: show the language servers that started before the Language Servers view opened - #1859
Merged
angelozerr merged 1 commit intoNov 4, 2026
Conversation
…rs view opened LanguageServerExplorer.loadAsync loaded the definitions and the started servers in parallel. When the started servers came first, their definition had no node yet and their status was lost, so the view showed no process node until the next LSP message or status change. The started servers are now loaded after the definitions. Signed-off-by: Daniel Biehl <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change addressing the Language Servers view initialization race.
No open issues 🎉
What changed in this PR
Fixes an initialization race in the Language Servers view that could leave already-running servers without process nodes, status, or consoles until a later server event.
Changes:
- Loads started-server state only after definition nodes have been created.
- Adds a test-only accessor for the panel’s explorer.
- Adds a regression test that opens the view ten times and checks an existing server’s process node and status.
| File | Description |
|---|---|
src/test/java/com/redhat/devtools/lsp4ij/console/LanguageServerExplorerLoadTest.java |
Tests loading the view with an already-started server. |
src/main/java/com/redhat/devtools/lsp4ij/console/LSPConsoleToolWindowPanel.java |
Exposes the explorer through a package-private, test-only accessor. |
src/main/java/com/redhat/devtools/lsp4ij/console/explorer/LanguageServerExplorer.java |
Sequences started-server loading after definition-node creation. |
Review effort: Balanced
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1859 +/- ##
==========================================
+ Coverage 42.67% 43.43% +0.76%
==========================================
Files 798 798
Lines 30562 30565 +3
Branches 6116 6116
==========================================
+ Hits 13042 13276 +234
+ Misses 15293 15008 -285
- Partials 2227 2281 +54 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
@coderabbitai full review |
Action performed
|
Contributor
|
LGTM, thanks @d-biehl ! |
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.
Split from #1853, as you asked.
When the Language Servers view opens,
LanguageServerExplorer.loadAsyncruns two steps: it loads the definitions and creates their nodes, and it loads the started servers and creates their process nodes. The two run as separate non-blocking read actions, so their order isn't fixed. When the started servers come first, their definition has no node yet.updateServerStatusthen returns without doing anything, and the status of that server is lost. The view shows the server without a process node, so without its status and its consoles, until its next LSP message or status change creates the node. For an idle server, that can take a while.To see it, start a language server by opening a file, and then open the Language Servers view for the first time in that project. It doesn't happen every time, because it depends on which step finishes first.
The second step now starts when the first one has finished. Nothing else changes.
LanguageServerExplorerLoadTestopens the view ten times with a server already running, and it fails without the fix. Locally, on Linux,./gradlew checkpasses (1,136 tests, 3 skipped). In PyCharm 2026.1 with RobotCode and a server already running, 15 of 25 new panels had no process node without the fix, and all 25 had it with the fix.