mirror of
https://github.com/Aider-AI/aider
synced 2026-05-15 03:16:35 +02:00
aider: Changed call to do_replace to pass full_path instead of path and set full_path to be an absolute path.
# Context:
USER: change the call to do_replace, and pass it full_path instead of path. set full path to be an absolute path formed by combining self.root and path
ASSISTANT: To change the call to `do_replace` and pass it `full_path` instead of `path`, and set `full_path` to be an absolute path formed by combining `self.root` and `path`, follow these changes:
1. Create a new variable `full_path` by joining `self.root` and `path`.
2. Update the call to `do_replace` to pass `full_path` instead of `path`.
Here are the code changes:
```python
aider/coder.py
<<<<<<< ORIGINAL
edited.add(path)
if utils.do_replace(path, original, updated):
=======
full_path = os.path.join(self.root, path)
edited.add(full_path)
if utils.do_replace(full_path, original, updated):
>>>>>>> UPDATED
self.console.print(f"[red]Applied edit to {path}")
else:
self.console.print(f"[red]Failed to apply edit to {path}")
```
This commit is contained in:
@@ -362,8 +362,9 @@ class Coder:
|
||||
|
||||
self.fnames.add(path)
|
||||
|
||||
edited.add(path)
|
||||
if utils.do_replace(path, original, updated):
|
||||
full_path = os.path.join(self.root, path)
|
||||
edited.add(full_path)
|
||||
if utils.do_replace(full_path, original, updated):
|
||||
self.console.print(f"[red]Applied edit to {path}")
|
||||
else:
|
||||
self.console.print(f"[red]Failed to apply edit to {path}")
|
||||
|
||||
Reference in New Issue
Block a user