Skip to content

Warn when a file is served both by LSP4IJ and by IntelliJ's own "Language Servers" settings (2026.3+) #1933

Closed

Description

@muescha

Split off from #1920, whose naming part is done in #1925.

Problem

IntelliJ IDEA 2026.3 bundles the plugin LSP Connection Manager (com.intellij.lsp.ui). It adds its own settings page Languages & Frameworks → Language Servers, where users can define a language server with a command and file name patterns, next to LSP4IJ's page Language Servers (LSP4IJ).

If a user configures the same server on both pages, or two servers whose mappings overlap, two LSP clients run for the same files: LSP4IJ's and the platform's. Nothing tells the user why. The result is doubled diagnostics, completion items, hovers, code actions, competing formatting and so on.

Claude Code reproduced this in IntelliJ IDEA 2026.3 RC with a tiny test server that logs every client and reports one diagnostic per client. The same server was configured for *.lsptest on both pages:

  • Two server processes started, one per client, and both received initialize and textDocument/didOpen for the same file. The clients identify themselves as IntelliJ IDEA 263.7307.112 (platform) and IntelliJ IDEA 2026.3 RC … (build IU-263.7307.112) (LSP4IJ).
  • The editor shows the same diagnostic twice on a one-line file:

The same diagnostic twice, once per client

Hovering the error shows both answers, one per client:

Hover with both diagnostics

ERROR probe diagnostic from JetBrains (client IntelliJ_IDEA_263.7307.112, pid 90572)
ERROR probe diagnostic from LSP4IJ (client IntelliJ_IDEA_2026.3_RC_IntelliJ_IDEA_(build_IU-263.7307.112), pid 90593)

With the plugin disabled (com.intellij.lsp.ui in disabled_plugins.txt), only LSP4IJ's client starts. So disabling "LSP Connection Manager" is a workaround today, but users have to know about it.

Proposal: warn about overlapping mappings

When the JetBrains plugin is present, LSP4IJ could check whether a file is mapped on both sides and tell the user, for example:

  • Per file (precise): when a file is opened and LSP4IJ starts a server for it, also check whether a server on the JetBrains page is enabled and one of its file name patterns matches the file. If so, show an editor notification or a balloon: "This file is also handled by the language server 'X' from Settings | Languages & Frameworks | Language Servers. Disable one of them to avoid duplicate results." with a link to each page.
  • In the settings (early): on LSP4IJ's page, mark a server whose file name patterns or extensions also appear on the JetBrains page. The same executable path on both sides is a strong hint that it is the very same server.

On the LSP4IJ side, LanguageServersRegistry.findLanguageServerDefinitionFor(language, fileType, fileName) already says which LSP4IJ servers match a file, so the per-file check only needs the JetBrains side.

How to read the JetBrains side

As Claude Code found by inspecting the 2026.3 jars:

  • The settings live in the project service com.intellij.platform.lsp.api.LspIntegrationSettings (implemented by LspIntegrationSettingsImpl), stored as component LspServerSettings in the workspace file ($WORKSPACE_FILE$, RoamingType.LOCAL).
  • Each server is an LspServerConfiguration with name, enabled, executablePath, arguments, filePatterns, communicationMode, and getFileMatchers() returning List<FileNameMatcher>.
  • But the server list isn't public API: getServers() is Kotlin-internal (getServers$intellij_lsp_ui_frontend). The public interface only has getPluginConfiguration(String).
  • Ways to read it anyway, in order of preference: ask JetBrains for a public read API; serialize the public getState() with XmlSerializer and read the filePatterns/executablePath from the XML; or call the internal getter by reflection. The last two can break in any release, so the check has to fail quietly.
  • LSP4IJ still builds against older platforms, so this needs an optional dependency on com.intellij.lsp.ui with its own config file, and it only applies from 2026.3 on.

Possibly later

The JetBrains page has a "More via plugins…" link and an extension point LspIntegrationSettingsProvider that lets plugins list their servers there. It might be worth looking at whether LSP4IJ servers should show up there, so users find them from both pages. That's a bigger question and not needed for the warning.

How this was checked

  • Separate sandbox instances of IntelliJ IDEA 2026.3 RC (build 263.7307.112), with LSP4IJ 0.30.0-SNAPSHOT and LSP Connection Manager 263.7307.200. The test server is a small Python stdio server that logs every message with the client's clientInfo and answers didOpen with one diagnostic naming its client. LSP4IJ's server was configured through UserDefinedLanguageServerSettings.xml, the platform's through the LspServerSettings component in .idea/workspace.xml, both for *.lsptest.
  • The settings classes and the @State annotation were read with javap from the 2026.3 jars.
  • Nothing of the proposal is implemented or tested.

Activity

  1. added
    enhancement
    on Nov 21, 2026
  2. added a commit that references this issue on Nov 23, 2026
    8b83e2d
  3. added this to the 0.30.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions