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 file opened while its language server starts can keep the editor behavior of a file that no language server serves (no Ctrl+hover on semantic tokens) #2157
EditorBehaviorFeature computes flags for each file from the file's language servers. The flags turn on:
the semantic tokens-based file view provider of TextMate, plain text and abstract file types;
the string literal, statement terminator, Enter between braces and TextMate nested braces improvements.
It caches each flag in a CachedValue whose dependencies are the language servers' modification trackers (LanguageServiceAccessor.getModificationTrackers(file)).
A CachedValue reads its dependencies' modification counts after it has computed the value (CachedValueBase.computeData). If the file's language server starts while a flag is computed, the start changes the counts before they're read. The cache then keeps the flag computed without the started server (false) until a language server changes again: one starts, stops, or has its configuration changed.
Effect
For a file opened as its language server starts, such as at IDE start or on first open:
No Ctrl+hover: the semantic tokens-based file view provider stays disabled. Highlighting shows the tokens, but none are kept in the view provider, so Ctrl+hover shows no hint and semantic-token navigation finds nothing.
No editor improvements: the improvements above are off.
The window is narrow, since the server's start must land inside one computation of the flag, so it's more likely under load.
The flag's first computation ran inside configureByText and returned false, although the server had started by the time it ended.
The element at the caret was then the whole-file stub token, isIdentifier was UNSURE, and the hint was null in 0 ms.
Not new: a 500 ms pause inside that computation makes 12 of the test class's 15 tests fail on main, and 13 of 15 on 0.30.1. The caching code is unchanged since March 2025.
Under load on 2024.2: the class failed 10 times in 5,600 runs.
Fix
Read the counts before computing the flag, and compute it again once any of them has changed. A PR follows.
Activity
fix: give a file opened while its language server starts the editor b…