mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
fixed regex
This commit is contained in:
parent
4840cb0966
commit
9e4ba5ee4b
2 changed files with 13 additions and 5 deletions
2
coder.py
2
coder.py
|
@ -294,7 +294,7 @@ class Coder:
|
||||||
return ''.join(resp)
|
return ''.join(resp)
|
||||||
|
|
||||||
|
|
||||||
pattern = re.compile(r'(\S+)\s+<<<<<<< ORIGINAL\n(.*?)\n=======\n(.*\n?)>>>>>>> UPDATED$', re.MULTILINE | re.DOTALL)
|
pattern = re.compile(r'(\S+)\s+<<<<<<< ORIGINAL\n(.*?)\n=======\n(.*?\n?)>>>>>>> UPDATED', re.MULTILINE | re.DOTALL)
|
||||||
|
|
||||||
def update_files(self, content, inp):
|
def update_files(self, content, inp):
|
||||||
|
|
||||||
|
|
16
prompts.py
16
prompts.py
|
@ -7,7 +7,7 @@ I want you to act as an expert software engineer and pair programmer.
|
||||||
You are to take requests from the user for new features, improvements, bug fixes and other changes to the code.
|
You are to take requests from the user for new features, improvements, bug fixes and other changes to the code.
|
||||||
If the user's request is ambiguous, ask questions to fully understand.
|
If the user's request is ambiguous, ask questions to fully understand.
|
||||||
|
|
||||||
For each change to the code, describe it using the ORIGINAL/UPDATED format shown in the examples below.
|
# For each change to the code, describe it using the ORIGINAL/UPDATED format shown in the examples below.
|
||||||
|
|
||||||
First line is the full filename, including path
|
First line is the full filename, including path
|
||||||
Next line is exactly: <<<<<<< ORIGINAL
|
Next line is exactly: <<<<<<< ORIGINAL
|
||||||
|
@ -16,7 +16,7 @@ Next line is exactly: =======
|
||||||
Followed by the new lines to replace the original chunk
|
Followed by the new lines to replace the original chunk
|
||||||
Last line is exactly: >>>>>>> UPDATED
|
Last line is exactly: >>>>>>> UPDATED
|
||||||
|
|
||||||
Here are examples:
|
# Here are examples:
|
||||||
|
|
||||||
path/to/filename.ext
|
path/to/filename.ext
|
||||||
<<<<<<< ORIGINAL
|
<<<<<<< ORIGINAL
|
||||||
|
@ -34,8 +34,16 @@ example.py
|
||||||
# Function to multiply two numbers using the standard algorithm
|
# Function to multiply two numbers using the standard algorithm
|
||||||
>>>>>>> UPDATED
|
>>>>>>> UPDATED
|
||||||
|
|
||||||
Be selective!
|
# To add lines to end of a file, use the special form of including an *empty* ORIGINAL block:
|
||||||
Only return the parts of the code which need changes!
|
|
||||||
|
some/file.txt
|
||||||
|
<<<<<<< ORIGINAL
|
||||||
|
=======
|
||||||
|
These lines will
|
||||||
|
be added to the end
|
||||||
|
of the file
|
||||||
|
>>>>>>> UPDATED
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
returned_code = '''
|
returned_code = '''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue