mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
refactor: Add CommandCompletionException for autocompletion handling
This commit is contained in:
parent
c6289c2bea
commit
ddef8c2499
2 changed files with 12 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue