Skip to content

feat(lsp): support multiple servers per document - #383

Merged
fcoury-oai merged 3 commits into
mainfrom
fcoury/multi-server-lsp
Oct 14, 2026
Merged

fcoury-oai merged 3 commits into
mainfrom
fcoury/multi-server-lsp

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Red currently selects one configured language server for each document. TypeScript users therefore have to choose between TypeScript language intelligence and ESLint diagnostics/actions when both servers match the same file.

This change keeps every matching server attached to the document while preserving deterministic routing for single-result features. Document lifecycle and versions are tracked per attachment, diagnostics remain owned by their producing server, and code actions aggregate across all capable servers with source-aware follow-up commands and workspace edits. A failed or restarted server is quarantined independently, so healthy peers continue serving the document. External formatter selection is unchanged, including Prettier precedence for the included TypeScript fixture.

The language documentation now explains overlapping server behavior, and tests/fixtures/multi_server_lsp/ records the pinned TypeScript + ESLint reproduction.

CleanShot 2026-10-14 at 16 13 12

TypeScript hover and ESLint diagnostics working together in the same buffer.

Closes #382.

How to Test

  1. Install the versions listed in tests/fixtures/multi_server_lsp/README.md and put their binaries on PATH.
  2. Use tests/fixtures/multi_server_lsp/config.toml as the Red configuration and open tests/fixtures/multi_server_lsp/index.ts.
  3. Press D. The diagnostics view should include findings from both TypeScript and ESLint.
  4. Press Space c a. The picker should contain actions from both servers; applying an ESLint action should route the edit and any command back to ESLint.
  5. Press Space f. Formatting should still use Prettier.
  6. Repeat with the ESLint executable unavailable. TypeScript completion and diagnostics should continue working while only ESLint is unavailable.

Automated coverage exercises overlapping selector resolution, independent lifecycle/version tracking, capable-provider routing, aggregated code actions, producer-scoped diagnostics, stale response rejection, completion provenance, rename/close cleanup, and failed-peer isolation.

Validated with:

  • cargo test --quiet --all-targets --all-features -- --test-threads=1
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check

@fcoury-oai
fcoury-oai merged commit bf2c203 into main Oct 14, 2026
12 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/multi-server-lsp branch October 14, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multiple language servers per document: TypeScript + ESLint

1 participant