mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +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"
|
||||
for edit in failed:
|
||||
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"""
|
||||
## SearchReplaceNoExactMatch: This SEARCH block failed to exactly match lines in {path}
|
||||
<<<<<<< SEARCH
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue