mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
aider: Saving dirty files before chat
# Context: USER: move that import up with the others ASSISTANT: To move the import statement to the top with the other imports, make the following change: ```python aider/getinput.py <<<<<<< ORIGINAL from prompt_toolkit.styles import Style from prompt_toolkit import prompt from prompt_toolkit.completion import Completer, Completion from prompt_toolkit.history import FileHistory ======= import re from prompt_toolkit.styles import Style from prompt_toolkit import prompt from prompt_toolkit.completion import Completer, Completion from prompt_toolkit.history import FileHistory >>>>>>> UPDATED ``` This change moves the `import re` statement to the top with the other import statements.
This commit is contained in:
parent
a87de46371
commit
b1fa3b91f9
1 changed files with 2 additions and 2 deletions
|
@ -1,10 +1,10 @@
|
|||
import re
|
||||
from prompt_toolkit.styles import Style
|
||||
|
||||
from prompt_toolkit import prompt
|
||||
from prompt_toolkit.completion import Completer, Completion
|
||||
from prompt_toolkit.history import FileHistory
|
||||
|
||||
|
||||
class FileContentCompleter(Completer):
|
||||
def __init__(self, fnames):
|
||||
self.fnames = fnames
|
||||
|
@ -19,7 +19,7 @@ class FileContentCompleter(Completer):
|
|||
for fname in self.fnames:
|
||||
with open(fname, "r") as f:
|
||||
content = f.read()
|
||||
import re
|
||||
|
||||
for word in re.split(r'\W+', content):
|
||||
if word.startswith(last_word):
|
||||
yield Completion(word, start_position=-len(last_word))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue