Skip to content
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

Feature proposal: Command specific autocompletion #229

Open
cldwalker opened this issue Jul 29, 2019 · 0 comments
Open

Feature proposal: Command specific autocompletion #229

cldwalker opened this issue Jul 29, 2019 · 0 comments

Comments

@cldwalker
Copy link

Hi. Thanks for the handy library. I've written a couple of commands that take package names. I would like those commands to autocomplete with package names. Would you be open to allowing users to define command-specific completions? If so, some thoughts on how this could work:

  • Commands would be registered with a basic api like Ex.registerCommandCompletions('command_name', completionFn). completionFn would be a function that takes one argument, the string of text after a command. For example, if a user typed command foo bar, the completionFn would receive 'foo bar'.
  • If a command doesn't have a completionFn registered, default to the excellent file completion introduced in Implement tab completion #29

Let me know your thoughts. Can create a PR if interested.
Cheers, Gabriel

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

No branches or pull requests

1 participant