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 language server added while several projects are open starts once more in every other open project, for that project's open files #2224
With several projects open in one IDE, adding a language server definition (a user-defined server, or one that a plugin registers) starts the server in every open project, for the open files of all open projects. So a file gets one instance of the server per open project. All but one of these instances are started with another project's root and workspace folders.
Cause
When a definition is added, the LanguageServiceAccessor of every open project hears it. Its checkCurrentlyOpenFiles then goes through the open files of every open project (ProjectManager.getOpenProjects()). But it connects them through its own project (sendDidOpenAndRefreshEditorFeatureFor uses the accessor's project). So each project's accessor starts the server for the other projects' files too.
How to reproduce
Open two projects, A and B, each with a file open that a language server would match.
Add a user-defined language server for that file type.
The LSP console shows two instances of the server for each file: one for the file's own project, and one started by the other project's accessor, with that project's root.
Seen in
The flaky LSPSemanticTokenDocumentationProviderTest.testPlainTextOfTwoLanguageServers on Linux CI (about 3 of 520 jobs since 2026-11-23). In the CI JVM, the light tests' shared project stays open. So addSecondServer started the second server twice, and the two starts raced in the test's mock server. When the test project's own start failed, the hover had only the first server's text.
Activity
test: the mock language server connects the clients of several starts…
fix: a language server added while several projects are open starts o…