mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
Connect FileContentCompleter
to prompt()
call in get_input()
for autocompletion.`
# Context: USER: connect the filecontentcompleter to the prompt() call in get_input, so that it autocompletes ASSISTANT: To connect the `FileContentCompleter` to the `prompt()` call in the `get_input` method, you need to pass the `FileContentCompleter` instance as the `completer` argument in the `prompt()` function. Here's the change: ```python coder.py <<<<<<< ORIGINAL if multiline_input: line = prompt(". ") else: line = prompt("> ") ======= completer_instance = FileContentCompleter(self.fnames) if multiline_input: line = prompt(". ", completer=completer_instance) else: line = prompt("> ", completer=completer_instance) >>>>>>> UPDATED ``` This change will enable autocompletion using the `FileContentCompleter` when you call `prompt()`.
This commit is contained in:
parent
36d15d5f37
commit
59e664e220
1 changed files with 5 additions and 4 deletions
5
coder.py
5
coder.py
|
@ -156,10 +156,11 @@ class Coder:
|
|||
|
||||
while True:
|
||||
try:
|
||||
completer_instance = FileContentCompleter(self.fnames)
|
||||
if multiline_input:
|
||||
line = prompt(". ")
|
||||
line = prompt(". ", completer=completer_instance)
|
||||
else:
|
||||
line = prompt("> ")
|
||||
line = prompt("> ", completer=completer_instance)
|
||||
except EOFError:
|
||||
return
|
||||
if line.strip() == "{" and not multiline_input:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue