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:
Paul Gauthier 2023-05-10 09:30:37 -07:00
parent 1fe0f713d4
commit c725a830b8

View file

@ -362,8 +362,9 @@ class Coder:
self.fnames.add(path) self.fnames.add(path)
edited.add(path) full_path = os.path.join(self.root, path)
if utils.do_replace(path, original, updated): edited.add(full_path)
if utils.do_replace(full_path, original, updated):
self.console.print(f"[red]Applied edit to {path}") self.console.print(f"[red]Applied edit to {path}")
else: else:
self.console.print(f"[red]Failed to apply edit to {path}") self.console.print(f"[red]Failed to apply edit to {path}")