Repository navigation
fix(vscode): cache the reactivity analysis language service per project - #6327
Merged
johnsoncodehk merged 2 commits intoDec 3, 2026
Merged
johnsoncodehk merged 2 commits into
johnsoncodehk merged 2 commits into
Conversation
The single-file language service was module-global, so it stayed bound to the language of the project that first requested an analysis. Every later file was then resolved through that project's host, which attached it to the wrong project.
johnsoncodehk
pushed a commit
that referenced
this pull request
Dec 3, 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.
Reactivity Visualization attaches analyzed files to the wrong tsconfig project. Open a
.vuefile and a.jsfile that belong to separate projects and analyze the.vuefile first, and tsserver starts reporting the.jsfile as part of the.vuefile's project. If that project's program does not contain the file, as with a JS entry file under atsconfig.app.jsonwithoutallowJs, every semantic request for it then fails with "Could not find source file", so hover and completion answer nothing.reactivityAnalysisPlugin.tskept the single-file language service in a module-level variable (together withcurrentFileName/currentSnapshot/currentVersion), so the host created on the first_vue:getReactivityAnalysiscall stayed decorated with that call'slanguage. Later calls read the rightlanguageoff the project but still ran the old service, so scripts were resolved through the first project'slanguageand from there through that project'sts.server.Projecthost, which attaches the file to the project and makes it the file's default project.getReactivityAnalysisnow keeps one service perlanguagein aWeakMap, each with its own file/snapshot/version state, so the service caching from #5652 is preserved and the first project's host is never asked for another project's file. The cost is one small single-file service per project, released with thelanguageonce the project is gone.Caching the service was introduced in 3bfd059 (#5652) and moved into this plugin in 9066601 (#5672).
fix #6325