-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: add autoformatting detection for edit tools #7660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implement autoformatting detection similar to Cline's approach to improve reliability of edit operations. When edit tools (multiEdit/editFile) are executed, the system now captures file content before and after save operations to detect editor autoformatting changes. Key changes: - Add `createPrettyPatch` utility using existing `myersDiff` function - Capture pre/post save content in `processDiff.ts` - Add `autoFormattingDiff` field to `ApplyState` protocol - Include autoformatting diff in tool responses with guidance for language model - Help prevent future edit failures due to undetected formatting changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
💡 To request a new review, comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 5 files
🎉 This PR is included in version 1.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Implementation Details
Key Components Added
Diff Utility (
diffUtils.ts
)createPrettyPatch
function using Continue's existingmyersDiff
normalizeContent
helper for content comparisonSave Logic Enhancement (
processDiff.ts
)ide.saveFile()
callProtocol Updates
autoFormattingDiff?: string
field toApplyState
interfacecore/config/types.ts
andcore/index.d.ts
Tool Response Enhancement (
handleApplyStateUpdate.ts
)Benefits
myersDiff
function for consistencyTest Plan
Summary by cubic
Detects editor auto-formatting on save for multiEdit/editFile and returns a diff with the tool output. This makes follow-up edits more reliable when Prettier or format-on-save changes the file.