aider/aider
Paul Gauthier d50e9755ed aider: Added completions_drop method that returns the list of active files that are also in self.coder.fnames.
# 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`.
2023-05-10 16:02:29 -07:00
..
__init__.py initial 2023-05-09 11:00:32 -07:00
coder.py aider: Fixed unused import, long line, undefined name, and missing f-string placeholder. 2023-05-10 15:40:48 -07:00
commands.py aider: Added completions_drop method that returns the list of active files that are also in self.coder.fnames. 2023-05-10 16:02:29 -07:00
dump.py moved into subdir 2023-05-09 10:52:18 -07:00
getinput.py allow /commands to provide their own completions 2023-05-10 16:00:04 -07:00
main.py added aider: prefix to gpt generated edits 2023-05-09 14:06:26 -07:00
prompts.py added prompt to explain how gpt can create new files 2023-05-10 09:38:54 -07:00
test_utils.py moved into subdir 2023-05-09 10:52:18 -07:00
utils.py aider: Added display_fname arg to quoted_file and updated call to quoted_file to pass relative file path. 2023-05-10 09:24:27 -07:00