feat: add multi-edit tool - #10
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughIntroduces ChangesMulti-file editing
Sequence Diagram(s)sequenceDiagram
participant Caller
participant MultiEditTool
participant FileSystem
participant Linter
Caller->>MultiEditTool: submit edit batch
MultiEditTool->>FileSystem: read and validate target files
MultiEditTool->>MultiEditTool: merge edits and build preview
MultiEditTool->>Linter: validate final content
Linter-->>MultiEditTool: return lint result
MultiEditTool->>FileSystem: atomically write files
MultiEditTool-->>Caller: return preview or applied summary
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/dch-tools/src/multi_edit.rs`:
- Around line 147-152: Update the overlap validation around overlap_check in the
multi-edit flow to run for both dry-run and apply modes by removing the
parsed.dry_run guard. Preserve the existing conflict result handling through
reason.into_output() so previews and actual applies use identical overlap
checks.
- Around line 424-435: Update symlink_check to validate every component of each
operation’s full_path, not just the final component, rejecting any symlink
encountered while traversing parent directories. Perform the check without
following links and preserve the no-symlink traversal guarantee through the
subsequent write path.
- Around line 682-709: Update build_preview to render each file’s complete
original content against its merged final content rather than comparing
originals with individual op.new_text fragments. Reuse the existing merged
finals representation if available, or track sequential edits per file so
operations on the same file are reflected cumulatively while preserving the
current preview formatting.
- Around line 174-183: Update the Phase 4 write flow around the operations loop
and atomic_write calls so writes across multiple files satisfy the tool’s
all-or-nothing contract: stage all final contents first, then commit
transactionally with rollback or recovery if any commit fails. Ensure a
later-file failure does not leave earlier files modified; otherwise narrow the
advertised guarantee instead of retaining the current claim.
- Around line 301-306: Update the path construction in the multi-edit flow
around full_path and dup_path_check to derive the identity from a normalized or
canonicalized physical path, so aliases such as a.rs and ./a.rs compare as
duplicates. Retain the original file_path for display and error messages, while
using the normalized identity consistently for merging and write operations.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fd1c0f49-6c52-4bed-a73f-be9b3c250edc
📒 Files selected for processing (11)
crates/dch-tools/src/bash.rscrates/dch-tools/src/context.rscrates/dch-tools/src/diff.rscrates/dch-tools/src/edit.rscrates/dch-tools/src/lib.rscrates/dch-tools/src/linter.rscrates/dch-tools/src/multi_edit.rscrates/dch-tools/src/question.rscrates/dch-tools/src/registry.rscrates/dch-tools/src/runtime.rscrates/dch-tools/src/state.rs
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
✅ Action performedReview finished.
|
No description provided.