diff with move hint

This commit is contained in:
Paul Gauthier 2023-12-18 19:09:32 -08:00
parent d9a301c9f8
commit ef2a1f3875
3 changed files with 5 additions and 1 deletions

View file

@ -174,6 +174,8 @@ Include *ALL* the code being searched and replaced!
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:
- A new file path, including dir name if needed
- An empty `SEARCH` section

View file

@ -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.
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`.
You are diligent and tireless!

View file

@ -157,7 +157,7 @@ def process(entry):
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 = dname / f"{fname.stem}_{class_name}_{method_name}"