diff --git a/aider/commands.py b/aider/commands.py index 47829aa04..4ded7fe8a 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1089,13 +1089,16 @@ class Commands: ) def completions_ask(self): - raise NotImplementedError("Use normal autocompleter") + from aider.io import CommandCompletionException + raise CommandCompletionException() def completions_code(self): - raise NotImplementedError("Use normal autocompleter") + from aider.io import CommandCompletionException + raise CommandCompletionException() def completions_architect(self): - raise NotImplementedError("Use normal autocompleter") + from aider.io import CommandCompletionException + raise CommandCompletionException() def cmd_ask(self, args): """Ask questions about the code base without editing any files. If no prompt provided, switches to ask mode.""" # noqa diff --git a/aider/io.py b/aider/io.py index f7ffa3306..ffb364e23 100644 --- a/aider/io.py +++ b/aider/io.py @@ -187,9 +187,12 @@ class AutoCompleter(Completer): return if text[0] == "/": - # catch and handle here; make a purpose built exception for this. ai! - yield from self.get_command_completions(document, complete_event, text, words) - return + try: + yield from self.get_command_completions(document, complete_event, text, words) + return + except CommandCompletionException: + # Fall through to normal completion + pass candidates = self.words candidates.update(set(self.fname_to_rel_fnames))