refactor: improve file path handling and remove debug code

This commit is contained in:
Paul Gauthier 2024-12-01 08:27:15 -08:00 committed by Paul Gauthier (aider)
parent ee4206099a
commit 59af7ed3bb
4 changed files with 3 additions and 4 deletions

View file

@ -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):

View file

@ -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)

View file

@ -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()

View file

@ -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):