fix(lsp): honor per-server formatting toggle#1958
Merged
bajrangCoder merged 2 commits intoAcode-Foundation:mainfrom Mar 17, 2026
Merged
fix(lsp): honor per-server formatting toggle#1958bajrangCoder merged 2 commits intoAcode-Foundation:mainfrom
bajrangCoder merged 2 commits intoAcode-Foundation:mainfrom
Conversation
Contributor
Greptile SummaryThis PR implements per-server control over the built-in LSP formatting feature by introducing a The previously duplicated Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User triggers format] --> B[formatter.ts callback]
B --> C{metadata available?}
C -- No --> D[toast: LSP formatter unavailable]
C -- Yes --> E{languageId resolved?}
E -- No --> F[toast: Unknown language]
E -- Yes --> G[getServersForLanguage\n.filter supportsBuiltinFormatting]
G --> H{servers.length > 0?}
H -- No --> I[toast: No LSP formatter available]
H -- Yes --> J[lspClientManager.formatDocument]
J --> K[getServersForLanguage]
K --> L{supportsBuiltinFormatting?}
L -- No --> M[skip server]
L -- Yes --> N[ensureClient]
N --> O{documentFormattingProvider\ncapability?}
O -- No --> M
O -- Yes --> P[send textDocument/formatting]
P --> Q{edits returned?}
Q -- No --> R[return true no-op]
Q -- Yes --> S[applyTextEdits]
S --> T[return true]
style D fill:#f99
style F fill:#f99
style I fill:#f99
style M fill:#eee
Last reviewed commit: fb40b99 |
Member
Author
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.
No description provided.