mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-09 06:05:00 +00:00
Fix ReplaceAll, using new git diff helper
This commit is contained in:
parent
46b0bee184
commit
26ec1c4f82
1 changed files with 3 additions and 3 deletions
|
@ -4,6 +4,7 @@ from .tool_utils import (
|
|||
validate_file_for_edit,
|
||||
apply_change,
|
||||
handle_tool_error,
|
||||
generate_unified_diff_snippet,
|
||||
format_tool_result,
|
||||
)
|
||||
|
||||
|
@ -33,8 +34,7 @@ def _execute_replace_all(coder, file_path, find_text, replace_text, change_id=No
|
|||
return f"Warning: No changes made (replacement identical to original)"
|
||||
|
||||
# 4. Generate diff for feedback
|
||||
# Note: _generate_diff_chunks is currently on the Coder class
|
||||
diff_examples = coder._generate_diff_chunks(original_content, find_text, replace_text)
|
||||
diff_examples = generate_unified_diff_snippet(original_content, new_content, rel_path)
|
||||
|
||||
# 5. Handle dry run
|
||||
if dry_run:
|
||||
|
@ -62,4 +62,4 @@ def _execute_replace_all(coder, file_path, find_text, replace_text, change_id=No
|
|||
return handle_tool_error(coder, tool_name, e, add_traceback=False)
|
||||
except Exception as e:
|
||||
# Handle unexpected errors
|
||||
return handle_tool_error(coder, tool_name, e)
|
||||
return handle_tool_error(coder, tool_name, e)
|
Loading…
Add table
Add a link
Reference in a new issue