feat: add lsp_format_document tool - #1194
Open
Dhirenderchoudhary wants to merge 2 commits into
Open
Conversation
Expose the existing LSP formatDocument API as an agent-callable tool so formatting can use the connected language server instead of guessing a CLI.
Dhirenderchoudhary
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
September 4, 2026 22:53
Contributor
No changeset foundThis PR does not add a changeset, so it will not appear in the changelog or trigger a release. If the change is user-facing, add one: pnpm changesetPick a bump (patch / minor / major) and write the changelog entry in our usual voice ("Added X... Thanks to @you. Closes #123."), then commit the generated If this PR is docs-only or a chore that needs no release note, you can ignore this - or run |
2 tasks
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.
Description
Adds an agent-callable
lsp_format_documenttool that uses the existingLSPManager.formatDocument()API to format a file via the connected language server, apply the returned edits, and write the result to disk. This replaces the need to guess a formatter CLI throughexecute_bash.Also wires approval, plan-mode exclusion, ACP tool kind, compact result display, and a short docs note.
Closes #1171
Type of Change
Changeset
pnpm changeset) describing this change for the changelogDocs-only or internal chores need no changeset (or run
pnpm changeset --emptyto note that intentionally).Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist