mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 11:14:59 +00:00
feat: Implement file path completion for read-only command
This commit is contained in:
parent
8e276939a7
commit
2d3605156e
1 changed files with 14 additions and 1 deletions
|
@ -580,7 +580,20 @@ class Commands:
|
||||||
return fname
|
return fname
|
||||||
|
|
||||||
def completions_raw_read_only(self, document, complete_event):
|
def completions_raw_read_only(self, document, complete_event):
|
||||||
pass
|
path_completer = PathCompleter(
|
||||||
|
only_directories=False,
|
||||||
|
get_paths=lambda: [self.coder.root],
|
||||||
|
file_filter=lambda fname: (
|
||||||
|
self.coder.repo is None
|
||||||
|
or not self.coder.repo.ignored_file(fname)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
word_before_cursor = document.get_word_before_cursor(WORD=True)
|
||||||
|
|
||||||
|
for completion in path_completer.get_completions(document, complete_event):
|
||||||
|
if completion.text.startswith(word_before_cursor):
|
||||||
|
yield completion
|
||||||
|
|
||||||
def completions_add(self):
|
def completions_add(self):
|
||||||
files = set(self.coder.get_all_relative_files())
|
files = set(self.coder.get_all_relative_files())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue