mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
![]() # Context: USER: create completions_drop which returns the list of get_active_files which are also in self.coder.fnames ASSISTANT: ```python aider/commands.py <<<<<<< ORIGINAL def cmd_drop(self, args): "Remove matching files from the chat" for word in args.split(): matched_files = [ file for file in self.coder.fnames if word in os.path.relpath(file, self.coder.root) ] if not matched_files: self.console.print(f"[red]No files matched '{word}'") for matched_file in matched_files: relative_fname = os.path.relpath(matched_file, self.coder.root) self.coder.fnames.remove(matched_file) self.console.print(f"[red]Removed {relative_fname} from the chat") ======= def completions_drop(self): active_files = self.coder.get_active_files() return [ os.path.relpath(file, self.coder.root) for file in self.coder.fnames if file in active_files ] def cmd_drop(self, args): "Remove matching files from the chat" for word in args.split(): matched_files = [ file for file in self.coder.fnames if word in os.path.relpath(file, self.coder.root) ] if not matched_files: self.console.print(f"[red]No files matched '{word}'") for matched_file in matched_files: relative_fname = os.path.relpath(matched_file, self.coder.root) self.coder.fnames.remove(matched_file) self.console.print(f"[red]Removed {relative_fname} from the chat") >>>>>>> UPDATED ``` I added the `completions_drop` method that returns the list of active files that are also in `self.coder.fnames`. |
||
---|---|---|
.. | ||
__init__.py | ||
coder.py | ||
commands.py | ||
dump.py | ||
getinput.py | ||
main.py | ||
prompts.py | ||
test_utils.py | ||
utils.py |