mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
diff with move hint
This commit is contained in:
parent
d9a301c9f8
commit
ef2a1f3875
3 changed files with 5 additions and 1 deletions
|
@ -174,6 +174,8 @@ Include *ALL* the code being searched and replaced!
|
||||||
|
|
||||||
Only *SEARCH/REPLACE* files that are *read-write*.
|
Only *SEARCH/REPLACE* files that are *read-write*.
|
||||||
|
|
||||||
|
To move code within a file, use 2 *SEARCH/REPLACE* blocks: 1 to delete it from its current location, 1 to insert it in the new location.
|
||||||
|
|
||||||
If you want to put code in a new file, use a *SEARCH/REPLACE block* with:
|
If you want to put code in a new file, use a *SEARCH/REPLACE block* with:
|
||||||
- A new file path, including dir name if needed
|
- A new file path, including dir name if needed
|
||||||
- An empty `SEARCH` section
|
- An empty `SEARCH` section
|
||||||
|
|
|
@ -96,6 +96,8 @@ When editing a function, method, loop, etc use a hunk to replace the *entire* co
|
||||||
Delete the entire existing version with `-` lines and then add a new, updated version with `+` lines.
|
Delete the entire existing version with `-` lines and then add a new, updated version with `+` lines.
|
||||||
This will help you generate correct code and correct diffs.
|
This will help you generate correct code and correct diffs.
|
||||||
|
|
||||||
|
To move code within a file, use 2 hunks: 1 to delete it from its current location, 1 to insert it in the new location.
|
||||||
|
|
||||||
To make a new file, show a diff from `--- /dev/null` to `+++ path/to/new/file.ext`.
|
To make a new file, show a diff from `--- /dev/null` to `+++ path/to/new/file.ext`.
|
||||||
|
|
||||||
You are diligent and tireless!
|
You are diligent and tireless!
|
||||||
|
|
|
@ -157,7 +157,7 @@ def process(entry):
|
||||||
|
|
||||||
print(f"{fname} {class_name} {method_name} {class_children} {method_children}")
|
print(f"{fname} {class_name} {method_name} {class_children} {method_children}")
|
||||||
|
|
||||||
dname = Path("tmp.benchmarks/refactor-benchmark-pylint")
|
dname = Path("tmp.benchmarks/refactor-benchmark-spyder")
|
||||||
dname.mkdir(exist_ok=True)
|
dname.mkdir(exist_ok=True)
|
||||||
|
|
||||||
dname = dname / f"{fname.stem}_{class_name}_{method_name}"
|
dname = dname / f"{fname.stem}_{class_name}_{method_name}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue