Repository navigation
feat(lsp): support multiple servers per document - #383
Merged
Merged
Conversation
This was referenced Oct 14, 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.
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.TypeScript hover and ESLint diagnostics working together in the same buffer.
Closes #382.
How to Test
tests/fixtures/multi_server_lsp/README.mdand put their binaries onPATH.tests/fixtures/multi_server_lsp/config.tomlas the Red configuration and opentests/fixtures/multi_server_lsp/index.ts.D. The diagnostics view should include findings from both TypeScript and ESLint.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.Space f. Formatting should still use Prettier.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=1cargo clippy --all-targets --all-features -- -D warningscargo fmt --all -- --check