Skip to content

Command name autocompletion #1380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

Argmaster
Copy link
Collaborator

@Argmaster Argmaster commented May 2, 2025

Description

This pull request adds the more trivial part of autocompletion - command name completion.

Behavior is as follows: use tab to find all partial matches, use tab again to cycle through them. Insert any character to confirm (eg. space). Completion for subcommands / command parameters is not supported yet.

Depends on: #1244 due to optional callbacks, actual diff is smaller than presented by Github right now,

Implementation details:

  • Moved command initialization to fn main() to guarantee command list is available. Right now we could WA this and just read command names, but this will be crucial for client side subcommand / parameter completion where callbacks for each command will be required.
  • Completion prefers longest match, I decided that this is most likely to be most beneficial, although completion list is not sorted, only longest match is selected to be first in O(n) time while forming completion list.

Links

Depends on: #1425

Argmaster and others added 30 commits March 25, 2025 06:14
Co-authored-by: IntegratedQuantum <[email protected]>
Co-authored-by: IntegratedQuantum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant