Repository navigation
fix: keep the LSP console from showing a time since 1970 for a language server after an installation - #2061
Merged
lagergren merged 1 commit intoNov 21, 2026
Conversation
…ge server after an installation The installation of the Installer tab stops and switches off the language server first. Already stopped, it gives stopping and stopped at once, from the installation's thread. The console compared each status with the one of its node, which takes a status on the EDT: the stopped came while the node still had the status before stopping, looked unchanged and was lost, so the node stayed stopping. A status taken while the language server is switched off has no start time, -1. Switched on again at the end of the installation, the node showed the spinner of stopping and the time since 1970, as 20375 d 15 h 40 m. The console now gives the node each status, and compares it with the node's once the node takes it. A node without a start time shows no time.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2061 +/- ##
=======================================
Coverage 49.49% 49.49%
=======================================
Files 813 813
Lines 33350 33352 +2
Branches 5195 5196 +1
=======================================
+ Hits 16505 16508 +3
+ Misses 14272 14268 -4
- Partials 2573 2576 +3 ☔ 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 #1335.
The time in #1335, 20375 d 15 h 40 m, is the time since 1970: 20375 days after 1970-01-01 is the day of the report. The language server row shows it because it lost a status:
LanguageServerView's pre-install action). Already stopped, it givesstoppingand thenstoppedat once, from the thread of the installation.stoppedcame the node still had the status from beforestopping.stoppedlooked unchanged, the console skipped it, and the node stayedstopping.stopping, then showed the spinner of a stop that had ended long before, and the time since -1.What looked like a start after the installation was that
stopping: nothing starts the language server there.The LSP console now passes each status on to the node, and compares it with the node's status once the node takes it, on the EDT (
LanguageServerExplorerLifecycleListener). A node without a start time shows no time (LanguageServerProcessTreeNode.getElapsedTime).Not here:
Test:
LanguageServerProcessNodesTest.testAStatusThatFollowsAnotherAtOnceOnAnotherThreadIsNotLostgives a language serverstoppingand thenstoppedfrom another thread, before the EDT runs, and checks that its node endsstopped. Without the change, it staysstopping.LanguageServerProcessTreeNodeTest.testAStatusTakenWhileSwitchedOffShowsNoTimeOnceSwitchedOngives a nodestoppingwhile its language server is switched off, switches it on, and checks that the node shows no time. Without the change, it shows the time since 1970. They and the console, installer,LanguageServerManagerand lifecycle tests pass (142 tests).