mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-07 05:05:01 +00:00
Added functionality to suggest similar lines when a search block fails to match in EditBlockCoder.
This commit is contained in:
parent
785259b59c
commit
587ba4d676
1 changed files with 6 additions and 0 deletions
|
@ -53,6 +53,12 @@ class EditBlockCoder(Coder):
|
||||||
res = f"# {len(failed)} SEARCH/REPLACE {blocks} failed to match!\n"
|
res = f"# {len(failed)} SEARCH/REPLACE {blocks} failed to match!\n"
|
||||||
for edit in failed:
|
for edit in failed:
|
||||||
path, original, updated = edit
|
path, original, updated = edit
|
||||||
|
|
||||||
|
full_path = self.abs_root_path(path)
|
||||||
|
content = self.io.read_text(full_path)
|
||||||
|
|
||||||
|
did_you_mean = find_similar_lines(original, content)
|
||||||
|
|
||||||
res += f"""
|
res += f"""
|
||||||
## SearchReplaceNoExactMatch: This SEARCH block failed to exactly match lines in {path}
|
## SearchReplaceNoExactMatch: This SEARCH block failed to exactly match lines in {path}
|
||||||
<<<<<<< SEARCH
|
<<<<<<< SEARCH
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue