Skip to content

feat(lsp): add multi-server support to CodeMirror LSP client - #2627

Open
bajrangCoder wants to merge 3 commits into
mainfrom
feat/multi-lsp-client
Open

feat(lsp): add multi-server support to CodeMirror LSP client#2627
bajrangCoder wants to merge 3 commits into
mainfrom
feat/multi-lsp-client

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

Summary

Vendor @codemirror/lsp-client into packages/lsp-client and add support
for attaching multiple independent language servers to a single CodeMirror
editor.

Implementation

  • Add multiple LSPClient bindings per EditorView
  • Add server priority and per-feature provider selection
  • Maintain independent synchronization state for each client
  • Aggregate results from compatible providers:
    • completions
    • hover
    • diagnostics
    • code actions
    • references
    • document colors
    • inlay hints
  • Route single-owner operations to the highest-priority capable server:
    • formatting
    • rename
    • definitions and navigation
    • signature help
    • document symbols
  • Preserve diagnostics from every attached server
  • Isolate provider failures so one server cannot suppress results from others
  • Clean up client-specific state when a server is detached

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR vendors the CodeMirror LSP client and extends Acode’s LSP integration to support multiple independently configured servers per editor.

  • Adds per-client synchronization, priority, feature selection, and lifecycle management.
  • Aggregates compatible multi-provider results while routing single-owner operations to the highest-priority provider.
  • Stores and clears diagnostics independently for each attached client.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/lsp-client/src/plugin.ts Adds multiple client-specific plugin bindings, feature gating, priority ordering, and independent synchronization state.
src/cm/lsp/clientManager.ts Attaches multiple server clients to each editor and coordinates per-client feature configuration and cleanup.
src/cm/lsp/diagnostics.ts Separates diagnostics by client and now consistently enforces diagnostics feature opt-out across push, pull, refresh, and display paths.
tests/unit/lspMultiClient.test.js Exercises multi-client selection, aggregation, isolation, and cleanup behavior.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  View[EditorView] --> Manager[LspClientManager]
  Manager --> P1[LSPPlugin: Server A]
  Manager --> P2[LSPPlugin: Server B]
  P1 --> A[Aggregate compatible features]
  P2 --> A
  P1 --> S[Select highest-priority owner]
  P2 --> S
  A --> View
  S --> View
Loading

Reviews (2): Last reviewed commit: "fix(lsp): honor diagnostics provider opt..." | Re-trigger Greptile

Comment thread src/cm/lsp/diagnostics.ts Outdated
@bajrangCoder

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant