feat(lsp): add multi-server support to CodeMirror LSP client - #2627
Merged
Conversation
Contributor
Greptile SummaryThe PR extends Acode’s CodeMirror LSP integration to support multiple independently configured language servers per editor.
Confidence Score: 5/5The PR appears safe to merge because the previously reported diagnostics opt-out bypass is fixed and no blocking failure remains. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
E[CodeMirror EditorView] --> R[Server registry ordered by priority]
R --> P1[LSP binding: server A]
R --> P2[LSP binding: server B]
P1 --> A[Aggregate compatible results]
P2 --> A
P1 --> S[Select highest-priority capable provider]
P2 --> S
A --> F[Diagnostics, actions, references, colors, hints]
S --> O[Formatting, rename, navigation, symbols]
P1 --> C[Per-client synchronization and cleanup]
P2 --> C
Reviews (3): Last reviewed commit: "fix" | Re-trigger Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
gat0sy
added a commit
to gat0sy/Acode
that referenced
this pull request
Aug 6, 2026
…m upstream multi-server Upstream's multi-server LSP refactor (Acode-Foundation#2627) introduced three regressions while merging into feat/lsp-improvements. 1. TDZ on `displayedView` in rename.ts and codeActions.ts The open-file path referenced `displayedView` before it was declared and incorrectly used `safeLspPositionToOffset()` instead of `mapping.mapPosition()`. Restored the intended behavior: - open files -> `view` + `mapping.mapPosition()` - closed files -> `displayedView` + `safeLspPositionToOffset()` 2. `plugin.docToHTML is not a function` in tooltipExtensions.ts The hover tooltip captured the wrong `plugin` instance. Fixed it to use `results[index].plugin` and `results[index].result.contents`, and render the generated HTML through a wrapper `<div>` using `.innerHTML`. 3. RangeError on EOF positions in rename/codeAction fallbacks Some LSP servers legitimately send `line: doc.lines, character: 0` to represent EOF. `lspPositionToOffset()` throws in this case because it doesn't clamp positions. Replaced it with `safeLspPositionToOffset()` from `textEditUtils.ts`, restoring bounds-safe position handling. These fixes preserve the upstream multi-server architecture while restoring the safety guarantees that were lost during the merge.
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.
Summary
Vendor
@codemirror/lsp-clientintopackages/lsp-clientand add supportfor attaching multiple independent language servers to a single CodeMirror
editor.
Implementation
LSPClientbindings perEditorView