mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
Added example
This commit is contained in:
parent
54c32283ee
commit
cd2fe5de05
1 changed files with 90 additions and 0 deletions
90
examples/semantic-search-replace.md
Normal file
90
examples/semantic-search-replace.md
Normal file
|
@ -0,0 +1,90 @@
|
|||
> Aider did a nice job of "semantic search and replace" here.
|
||||
> Notice that it isn't replacing exact strings.
|
||||
> It's dealing with various formatting and semantic differences in the calls that it is updating.
|
||||
|
||||
*Loading aider/coder.py*
|
||||
|
||||
---
|
||||
|
||||
#### coder.py> replace all the self.console.print() calls that contain [red] with calls to self.io.tool_error() with [red] removed from the string
|
||||
|
||||
```
|
||||
aider/coder.py
|
||||
<<<<<<< ORIGINAL
|
||||
self.console.print(
|
||||
f"[red]This tool will almost certainly fail to work with {main_model}"
|
||||
)
|
||||
=======
|
||||
self.io.tool_error(f"This tool will almost certainly fail to work with {main_model}")
|
||||
>>>>>>> UPDATED
|
||||
```
|
||||
|
||||
```
|
||||
aider/coder.py
|
||||
<<<<<<< ORIGINAL
|
||||
self.console.print("[red]No suitable git repo, will not automatically commit edits.")
|
||||
=======
|
||||
self.io.tool_error("No suitable git repo, will not automatically commit edits.")
|
||||
>>>>>>> UPDATED
|
||||
```
|
||||
|
||||
```
|
||||
aider/coder.py
|
||||
<<<<<<< ORIGINAL
|
||||
self.console.print("[red]Files are not in a git repo.")
|
||||
=======
|
||||
self.io.tool_error("Files are not in a git repo.")
|
||||
>>>>>>> UPDATED
|
||||
```
|
||||
|
||||
```
|
||||
aider/coder.py
|
||||
<<<<<<< ORIGINAL
|
||||
self.console.print("[red]Files are in different git repos.")
|
||||
=======
|
||||
self.io.tool_error("Files are in different git repos.")
|
||||
>>>>>>> UPDATED
|
||||
```
|
||||
|
||||
```
|
||||
aider/coder.py
|
||||
<<<<<<< ORIGINAL
|
||||
self.console.print("[red]Skipped adding new files to the git repo.")
|
||||
=======
|
||||
self.io.tool_error("Skipped adding new files to the git repo.")
|
||||
>>>>>>> UPDATED
|
||||
```
|
||||
|
||||
```
|
||||
aider/coder.py
|
||||
<<<<<<< ORIGINAL
|
||||
self.console.print("[red]Warning: no changes found in tracked files.")
|
||||
=======
|
||||
self.io.tool_error("Warning: no changes found in tracked files.")
|
||||
>>>>>>> UPDATED
|
||||
```
|
||||
|
||||
```
|
||||
aider/coder.py
|
||||
<<<<<<< ORIGINAL
|
||||
self.console.print("[red]Malformed ORIGINAL/UPDATE blocks, retrying...")
|
||||
self.console.print("[red]", Text(err))
|
||||
=======
|
||||
self.io.tool_error("Malformed ORIGINAL/UPDATE blocks, retrying...")
|
||||
self.io.tool_error(Text(err))
|
||||
>>>>>>> UPDATED
|
||||
```
|
||||
|
||||
Please note that I couldn't find the `self.io.tool_error()` method in the provided code. You may need to create this method in the appropriate class or provide the correct method name to replace the `self.console.print()` calls.
|
||||
|
||||
*Applied edit to aider/coder.py*
|
||||
*Applied edit to aider/coder.py*
|
||||
*Applied edit to aider/coder.py*
|
||||
*Applied edit to aider/coder.py*
|
||||
*Applied edit to aider/coder.py*
|
||||
*Applied edit to aider/coder.py*
|
||||
*Applied edit to aider/coder.py*
|
||||
|
||||
*919cfc2 aider: Replaced all self.console.print() calls with self.io.tool_error() calls with removed from the string.*
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue