From 59af7ed3bb68e193b83698ab1ca04e6290426106 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 1 Dec 2024 08:27:15 -0800 Subject: [PATCH] refactor: improve file path handling and remove debug code --- aider/commands.py | 3 ++- aider/io.py | 1 - aider/main.py | 2 +- aider/watch.py | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index f56152bc3..671a0534d 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -785,7 +785,8 @@ class Commands: self.io.tool_error(f"Unable to read {matched_file}") else: self.coder.abs_fnames.add(abs_file_path) - self.io.tool_output(f"Added {matched_file} to the chat") + fname = self.coder.get_rel_fname(abs_file_path) + self.io.tool_output(f"Added {fname} to the chat") self.coder.check_added_files() def completions_drop(self): diff --git a/aider/io.py b/aider/io.py index 7ff834950..f385af64c 100644 --- a/aider/io.py +++ b/aider/io.py @@ -319,7 +319,6 @@ class InputOutput: self.tool_error(f"{filename}: {e}") return - # add a silent=False arg that suppresses error output ai! def read_text(self, filename): if is_image_file(filename): return self.read_image(filename) diff --git a/aider/main.py b/aider/main.py index 20c6a59fd..f4e2c34ad 100644 --- a/aider/main.py +++ b/aider/main.py @@ -820,7 +820,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F ignores.append(str(Path(git_root) / ".gitignore")) if args.aiderignore: ignores.append(args.aiderignore) - FileWatcher(coder, encoding=io.encoding, gitignores=ignores) + FileWatcher(coder, gitignores=ignores, verbose=args.verbose) coder.show_announcements() diff --git a/aider/watch.py b/aider/watch.py index 5f1e3b638..6959e634b 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -212,7 +212,6 @@ Be sure to remove all these "ai" comments from the code! context.add_context() res += context.format() - dump(res) return res def get_ai_comments(self, filepath):