Repository navigation
fix: give a file opened while its language server starts the editor behavior of that language server - #2159
Merged
lagergren merged 1 commit intoNov 23, 2026
Conversation
…ehavior of that language server The flags of EditorBehaviorFeature, as the one that enables the semantic tokens-based file view provider of Ctrl+hover, were cached for each file in a CachedValue, with the modification trackers of the language servers of the file as its dependencies. A CachedValue reads the counts of its dependencies after it has computed the value. A language server that started while a flag was computed, as for a file opened while it starts, changed those counts before they were read: the flag kept the value of a file that no started language server serves until the next change of a language server. The semantic tokens-based file view provider of such a file then stayed disabled: the highlighting stored no semantic token in it, so Ctrl+hover showed no hint. LSPSemanticTokenDocumentationProviderTest failed on CI this way: once its second language server was added, the view provider was enabled again, without any token. A flag now keeps the counts read before it is computed, and is computed again once one of them has changed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2159 +/- ##
==========================================
+ Coverage 53.22% 53.23% +0.01%
==========================================
Files 826 826
Lines 34717 34744 +27
Branches 7143 7151 +8
==========================================
+ Hits 18477 18495 +18
- Misses 13468 13479 +11
+ Partials 2772 2770 -2 ☔ 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 #2157
What
LSPSemanticTokenDocumentationProviderTest.testPlainTextOfTwoLanguageServersfailed on CI now and then:The Ctrl+hover hint was null. It's a product bug, not a test bug. A file opened while its language server starts can keep the editor-behavior flags of a file that no started language server serves. Its semantic tokens-based file view provider then stays disabled, so Ctrl+hover shows no hint.
Cause
EditorBehaviorFeaturecached its flags in aCachedValuewhose dependencies are the language servers' modification trackers.A
CachedValuereads its dependencies' counts after computing the value (CachedValueBase.computeData). A language server that started during the computation changed the counts first, so the flag keptfalseuntil the next change of a language server. In the test:isIdentifierUNSURE, and no hint.The race is in 0.30.1 too; the caching code is unchanged since March 2025.
Change
EditorBehaviorFeaturekeeps each flag with the tracker counts read before the flag was computed, and computes it again once any of them has changed. This is the same pattern as 7fa1794, which reads the modification counts before a feature's requests are sent. Files outside the VFS are still computed each time.Behaviour change
Test
EditorBehaviorFeatureTest.testAFlagThatChangesWhileItIsComputedIsComputedAgainfails without the change and passes with it.client.features,features.semanticTokensandfeatures.documentationpass on IC 2024.2, IC 2025.3 and IU 2026.3 (55 tests, 0 failures, each).#2141 reports the same failure on 2026.3, with a different suspected cause.