Paul Gauthier
|
eef97e4938
|
fix: remove redundant import of shlex in commands.py
|
2024-09-27 16:53:14 -07:00 |
|
Paul Gauthier (aider)
|
36bc8f90db
|
fix: properly quote filenames with spaces and special characters using shlex.quote()
|
2024-09-27 16:52:06 -07:00 |
|
Paul Gauthier (aider)
|
c4e766a4c4
|
style: run linter and reorder import statements in commands.py
|
2024-09-27 16:51:01 -07:00 |
|
Paul Gauthier (aider)
|
8bb9bbef19
|
feat: modify PathCompleter to quote filenames with spaces in completions
|
2024-09-27 16:50:57 -07:00 |
|
Paul Gauthier
|
2a79723336
|
refactor: rename completions_add method to _old_completions_add for clarity
|
2024-09-27 16:50:57 -07:00 |
|
Paul Gauthier
|
542afbeb74
|
fix: Use self.coder.root instead of self.root in get_paths function
|
2024-09-27 16:48:55 -07:00 |
|
Paul Gauthier (aider)
|
9644546a65
|
feat: add get_paths function to PathCompleter for starting from self.root if not None
|
2024-09-27 16:47:47 -07:00 |
|
Paul Gauthier
|
79e0b80f34
|
Merge branch 'main' into path-completer
|
2024-09-27 16:46:24 -07:00 |
|
Paul Gauthier
|
7e4e6782d1
|
fix: set max_tokens to 1 for cache warming
|
2024-09-27 16:46:03 -07:00 |
|
Paul Gauthier (aider)
|
aab01086a2
|
style: fix formatting in base_coder.py
|
2024-09-27 16:43:24 -07:00 |
|
Paul Gauthier (aider)
|
f7818c6994
|
feat: Use **kwargs for extra_params in warm_cache_worker
|
2024-09-27 16:43:18 -07:00 |
|
Paul Gauthier
|
22c60cad1a
|
refactor: Replace extra_params with extra_headers in cache warming request
|
2024-09-27 16:43:17 -07:00 |
|
Paul Gauthier
|
237ee1c5a1
|
Merge branch 'main' into path-completer
|
2024-09-27 16:40:53 -07:00 |
|
Paul Gauthier (aider)
|
87e4010b8b
|
style: Run linter
|
2024-09-27 16:39:42 -07:00 |
|
Paul Gauthier (aider)
|
7830dadccf
|
fix: Remove unused imports in aider/commands.py
|
2024-09-27 16:39:37 -07:00 |
|
Paul Gauthier (aider)
|
6287bf37e5
|
feat: Implement partial prefix matching for /read-only command in completions_raw_read_only method
|
2024-09-27 16:39:26 -07:00 |
|
Paul Gauthier
|
369310a7c3
|
fix: Remove commented-out code in PathCompleter configuration
|
2024-09-27 16:39:25 -07:00 |
|
Paul Gauthier (aider)
|
7e1497e114
|
style: Run linter and fix code formatting issues in commands.py
|
2024-09-27 16:35:27 -07:00 |
|
Paul Gauthier (aider)
|
57257b7c15
|
fix: correct indentation error in completions_raw_read_only method in aider/commands.py
|
2024-09-27 16:35:22 -07:00 |
|
Paul Gauthier (aider)
|
68c4817c14
|
fix: adjust completions_raw_read_only to process only file path input for correct path completions
|
2024-09-27 16:34:55 -07:00 |
|
Paul Gauthier (aider)
|
c35a41466b
|
fix: correct completions_raw_read_only method to yield all path completions without unnecessary filtering
|
2024-09-27 16:25:39 -07:00 |
|
Paul Gauthier
|
bb740f3004
|
refactor: Replace extra_headers with extra_params in cache warming request
|
2024-09-27 16:22:17 -07:00 |
|
Paul Gauthier
|
c745d0dc38
|
wip
|
2024-09-27 16:21:18 -07:00 |
|
Paul Gauthier (aider)
|
9c5ef0b41a
|
style: run linter
|
2024-09-27 16:17:41 -07:00 |
|
Paul Gauthier (aider)
|
2d3605156e
|
feat: Implement file path completion for read-only command
|
2024-09-27 16:17:37 -07:00 |
|
Paul Gauthier
|
8e276939a7
|
feat: Implement completions_raw_read_only method
diff --git a/aider/commands.py b/aider/commands.py
index 80dd81dd..d4d4d4d1 100644
--- a/aider/commands.py
+++ b/aider/commands.py
@@ -580,7 +580,31 @@ class Commands:
return fname
def completions_raw_read_only(self, document, complete_event):
- pass
+ # Extract the part of the input after the command
+ text = document.text[len("/read-only") :].lstrip()
+
+ # Create a PathCompleter
+ path_completer = PathCompleter(
+ only_directories=False,
+ expanduser=True,
+ get_paths=lambda: [self.coder.root],
+ )
+
+ # Create a new Document object with the modified text
+ new_document = Document(text, cursor_position=len(text))
+
+ # Get completions from the PathCompleter
+ completions = path_completer.get_completions(new_document, complete_event)
+
+ # Yield the completions
+ for completion in completions:
+ # Adjust the start position to account for the command
+ yield Completion(
+ completion.text,
+ start_position=completion.start_position - len(document.text) + len(text),
+ display=completion.display,
+ display_meta=completion.display_meta,
+ )
def completions_add(self):
files = set(self.coder.get_all_relative_files())
|
2024-09-27 16:17:35 -07:00 |
|
Paul Gauthier (aider)
|
c2afdcfdb9
|
fix: Create new Document object for path completion in completions_raw_read_only
|
2024-09-27 16:10:16 -07:00 |
|
Paul Gauthier
|
8e02cadfbc
|
fix: Ensure command starts with slash before retrieving raw completions
|
2024-09-27 16:10:14 -07:00 |
|
Paul Gauthier (aider)
|
0a77b6cfac
|
feat: Add Completion import to aider/commands.py
|
2024-09-27 16:07:35 -07:00 |
|
Paul Gauthier (aider)
|
f8390a889b
|
style: Ran the linter
|
2024-09-27 16:06:44 -07:00 |
|
Paul Gauthier (aider)
|
b930a1db40
|
feat: Add raw completer for cmd_read_only command
|
2024-09-27 16:06:39 -07:00 |
|
Paul Gauthier (aider)
|
ee4de6bd1c
|
feat: Add get_raw_completions method to Commands class
|
2024-09-27 16:05:40 -07:00 |
|
Paul Gauthier (aider)
|
6c2c3942bf
|
feat: Add document and complete_event parameters to get_command_completions
|
2024-09-27 16:04:17 -07:00 |
|
Paul Gauthier
|
3ec0861727
|
fix: Add support for raw completers in AutoCompleter
|
2024-09-27 16:04:16 -07:00 |
|
Paul Gauthier (aider)
|
37b512e4fc
|
feat: Update get_command_completions and get_completions methods
|
2024-09-27 15:59:56 -07:00 |
|
Paul Gauthier
|
01437fa58c
|
copy
|
2024-09-27 14:29:35 -07:00 |
|
Paul Gauthier
|
927d03cc37
|
copy
|
2024-09-27 14:28:53 -07:00 |
|
Paul Gauthier (aider)
|
114fb2a889
|
style: Improve code formatting and readability
|
2024-09-27 14:26:56 -07:00 |
|
Paul Gauthier (aider)
|
f95c4626cf
|
fix: Handle clipboard copy errors in cmd_copy
|
2024-09-27 14:26:50 -07:00 |
|
Paul Gauthier (aider)
|
11db5d95a0
|
feat: Add /copy command to copy last assistant message
|
2024-09-27 14:25:22 -07:00 |
|
Paul Gauthier (aider)
|
7d79dd00af
|
style: Improve code formatting and readability
|
2024-09-27 14:21:43 -07:00 |
|
Paul Gauthier (aider)
|
0c470662bb
|
feat: Add /copy command to copy last assistant message to clipboard
|
2024-09-27 14:21:37 -07:00 |
|
Paul Gauthier
|
7c1318274e
|
Revert "feat: include non-repo files for completing /read"
This reverts commit d2fbc92507 .
|
2024-09-27 13:17:36 -07:00 |
|
Paul Gauthier
|
a766395651
|
Merge branch 'main' of github.com:paul-gauthier/aider
|
2024-09-27 13:16:15 -07:00 |
|
paul-gauthier
|
2dfc47f5c6
|
Merge pull request #1757 from jbellis/read-nonrepo
feat: include non-repo files for completing /read
|
2024-09-27 13:15:23 -07:00 |
|
Paul Gauthier
|
48bd616092
|
copy
|
2024-09-27 13:10:41 -07:00 |
|
Paul Gauthier
|
810aeccf94
|
fix: Replace extra_headers and extra_body with extra_params in Coder, ChatSummary, and GitRepo
|
2024-09-27 13:09:43 -07:00 |
|
Paul Gauthier (aider)
|
c24e947b18
|
style: Run linter
|
2024-09-27 13:02:47 -07:00 |
|
Paul Gauthier (aider)
|
74f615bbb4
|
feat: Consolidate extra parameters in sendchat.py
|
2024-09-27 13:02:44 -07:00 |
|
Paul Gauthier (aider)
|
eb0331baed
|
feat: wrap max_tokens in extra_params for ModelSettings
|
2024-09-27 13:01:20 -07:00 |
|