diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index b606aa554..896670d1f 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -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 diff --git a/aider/coders/udiff_prompts.py b/aider/coders/udiff_prompts.py index 8608152ad..14d1a73ac 100644 --- a/aider/coders/udiff_prompts.py +++ b/aider/coders/udiff_prompts.py @@ -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! diff --git a/benchmark/refactor_tools.py b/benchmark/refactor_tools.py index a29aa6e9a..1046efb11 100755 --- a/benchmark/refactor_tools.py +++ b/benchmark/refactor_tools.py @@ -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}"