Repository navigation
fix: an editor behavior flag computed while the file's language server starts is computed again once that language server changes it - #2262
Merged
lagergren merged 1 commit intoNov 25, 2026
Conversation
…r starts is computed again once that language server changes it EditorBehaviorFeatureTest.testAFlagThatChangesWhileItIsComputedIsComputedAgain failed now and then on IU 2026.3, headless. EditorBehaviorFeature.compute read the tracker counts after LanguageServiceAccessor.getModificationTrackers had looked up the started language servers of the file. A language server could be created after that lookup and have started before the counts were read. Its own tracker then wasn't kept. The count of the project's language servers, read last, already included its start. hasAny still computed the flag from it. Its later changes were missed, and the flag stayed cached until a language server of the project changed status or definition. In the test, the semantic tokens file view provider of the editor can compute the flag that way while the test starts the language server. It then takes the language server's first answer, false, and misses the change that the answer makes. The test's own computations get the cached false. The count of the project's language servers is now read first, before the lookup. Fixes redhat-developer#2261
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2262 +/- ##
==========================================
+ Coverage 55.82% 55.86% +0.04%
==========================================
Files 848 848
Lines 36265 36265
Branches 7502 7502
==========================================
+ Hits 20245 20261 +16
+ Misses 13103 13092 -11
+ Partials 2917 2912 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@coderabbitai review |
Action not completed
|
Collaborator
Author
|
@coderabbitai review |
Action performed
|
This was referenced Nov 25, 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 #2261
What
EditorBehaviorFeatureTest.testAFlagThatChangesWhileItIsComputedIsComputedAgain(from #2159) failed once in 5 runs of its class, headless, on IU 2026.3. It's a product race inEditorBehaviorFeature's flag cache, not a test bug.Cause
computeread the tracker counts afterLanguageServiceAccessor.getModificationTrackers(file)had looked up the started language servers of the file, including the project-level count that changes as a language server starts. Take a language server created after that lookup and started before the counts were read:hasAnystill computed the flag from it, so its later changes were missed until another status or definition change.In the test, the semantic tokens file view provider of the editor can compute the flag that way while the test starts the language server. It takes the first answer (
false) and misses the increment that answer makes. The test then reads the cachedfalse.Change
computereads the project-level count first, throughTrackerCount.of(languageServiceAccessor::getModificationCount), before the language servers of the file are looked up. TheFlagValueJavadoc says why. The test is unchanged.Behaviour change
Tests
client.features.*,features.formatting.*,features.semanticTokens.*andfeatures.documentation.*pass headless on all three platforms: 135 tests, 0 failures, 0 skipped each.Not in this PR
A language server that is already started and is put back among the started servers after a cancelled replacement still changes no count.