mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
ask llm are you sure? when REPLACE exists
This commit is contained in:
parent
90c0a5b9a4
commit
eea8e50c60
1 changed files with 7 additions and 4 deletions
|
@ -60,10 +60,8 @@ class EditBlockCoder(Coder):
|
|||
res += f"""
|
||||
## SearchReplaceNoExactMatch: This SEARCH block failed to exactly match lines in {path}
|
||||
<<<<<<< SEARCH
|
||||
{original}
|
||||
=======
|
||||
{updated}
|
||||
>>>>>>> REPLACE
|
||||
{original}=======
|
||||
{updated}>>>>>>> REPLACE
|
||||
|
||||
"""
|
||||
did_you_mean = find_similar_lines(original, content)
|
||||
|
@ -76,6 +74,11 @@ class EditBlockCoder(Coder):
|
|||
|
||||
"""
|
||||
|
||||
if updated in content:
|
||||
res += f"""Are you sure you need this SEARCH/REPLACE block?
|
||||
The REPLACE lines are already in {path}!
|
||||
|
||||
"""
|
||||
res += (
|
||||
"The SEARCH section must exactly match an existing block of lines including all white"
|
||||
" space, comments, indentation, docstrings, etc\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue