feat(commands): add named command registry and completion - #177
Merged
Conversation
Greptile SummaryThis PR introduces a static named-command registry and routes named commands and keybindings through shared application dispatch.
Confidence Score: 5/5The PR appears safe to merge, with no outstanding correctness, security, or repository-rule issues identified. The previously reported leading-whitespace completion problem is fully fixed by consistently normalizing input for lookup, parsing, matching, and completion, and its review thread is resolved. No new actionable failures remain.
|
| Filename | Overview |
|---|---|
| src/command_registry.rs | Defines the command registry, aliases, typed targets, parsing, validation, help, matching, completion, and focused tests; the previously reported leading-whitespace inconsistency is fixed. |
| src/app.rs | Routes keybindings and named invocations through shared application dispatch and integrates completion into the command prompt. |
| src/input.rs | Adds normalized plain-Tab input for command completion while leaving modified Tab combinations unhandled. |
| src/renderer.rs | Displays command-prefix hints without moving the editable input cursor. |
| src/commands.rs | Extends the typed command surface for registry-backed application actions. |
| README.md | Documents named commands, legacy aliases, completion, help, and current limitations. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
K[Keybinding] --> E[AppState::execute_command]
M[M-x prompt] --> P[Command registry parse]
P --> E
P --> H[Help and validation]
M --> C[Prefix matching and completion]
E --> A[Application-owned actions]
E --> D[commands::dispatch]
D --> B[Buffer and view changes]
Reviews (2): Last reviewed commit: "fix(commands): normalize leading spaces ..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M-xnow accepts stable command names such assave-buffer,find-file, andsearch-forward, with prefix hints and Tab completion.A static registry holds names, descriptions, aliases, and typed targets; named commands and keybindings share application dispatch.
Existing slash aliases remain available, and
help <command>explains each command.Closes #46.
Verification: