mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
promising BEFORE/AFTER command format change
This commit is contained in:
parent
fe13bf069d
commit
263aa19695
1 changed files with 24 additions and 9 deletions
33
coder.py
33
coder.py
|
@ -23,23 +23,20 @@ I want you to act as a web development pair programmer.
|
||||||
You are an expert at understanding code and proposing code changes in response to user requests.
|
You are an expert at understanding code and proposing code changes in response to user requests.
|
||||||
|
|
||||||
Your job is to:
|
Your job is to:
|
||||||
- Understand what the user wants changed in the code. Ask questions if needed.
|
- Understand what the user wants. Ask questions if needed.
|
||||||
- Use the BEFORE/AFTER editing command described below to suggest changes to the code.
|
- Suggest changes to the code.
|
||||||
|
|
||||||
DO NOT OUTPUT CODE BLOCKS EXCEPT BY USING THIS BEFORE/AFTER COMMAND FORMAT:
|
ONLY SUGGEST CODE CHANGES BY USING THIS EXACT BEFORE/AFTER COMMAND FORMAT:
|
||||||
|
|
||||||
BEFORE path/to/filename.ext
|
path/to/filename.ext
|
||||||
```
|
```BEFORE
|
||||||
... unchanged lines from the original file ...
|
... unchanged lines from the original file ...
|
||||||
... only include lines around needed changes! ...
|
... only include lines around needed changes! ...
|
||||||
... NEVER INCLUDE AN ENTIRE FILE! ...
|
... NEVER INCLUDE AN ENTIRE FILE! ...
|
||||||
```
|
```
|
||||||
AFTER
|
```AFTER
|
||||||
```
|
|
||||||
... new lines to replace them with ...
|
... new lines to replace them with ...
|
||||||
```
|
```
|
||||||
|
|
||||||
ALWAYS USE THE ``` DELIMITERS!
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
prompt_comments = '''
|
prompt_comments = '''
|
||||||
|
@ -174,6 +171,24 @@ MAKE ANY CHANGES BASED OFF THESE FILES!
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
inp = input()
|
inp = input()
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
if inp == 'fix':
|
||||||
|
inp = '''
|
||||||
|
It looks like you are trying to specify code changes. Repeat your previous message, but use the exact BEFORE/AFTER command format, like this:
|
||||||
|
|
||||||
|
BEFORE path/to/filename.ext
|
||||||
|
```
|
||||||
|
... unchanged lines from the original file ...
|
||||||
|
... only include lines around needed changes! ...
|
||||||
|
... NEVER INCLUDE AN ENTIRE FILE! ...
|
||||||
|
```
|
||||||
|
AFTER
|
||||||
|
```
|
||||||
|
... new lines to replace them with ...
|
||||||
|
```
|
||||||
|
|
||||||
|
The ``` delimiters are very important!
|
||||||
|
'''
|
||||||
return inp
|
return inp
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue