-
Notifications
You must be signed in to change notification settings - Fork 518
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
add a new shell completion provider #2858
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far I like the approach. The tests are more complete with the dynamic checks you do than what I had suggested, we just need to skip their execution in places where they're not available.
provider_get(P, bare) -> | ||
element(5, P); | ||
provider_get(P, short_desc) -> | ||
element(8, P); | ||
provider_get(P, namespace) -> | ||
element(12, P). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a messy bit, which I think you know. Not a blocker for now but we may need to go back at some point and update the providers lib to expose these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, if we're able to merge it and bump providers
version in rebar then I'd do a PR to expose these. @tsloughter ?
Also, I use |
Yeah this is going to be an issue in the short term. We currently support 24, 25, and 26. Once 27 is out, we'll deprecate 24, though. |
Solved via macro, we can remove it when <25 gets deprecated. Let me know if everything is good now so I can create support for Sorry about crashdump, mistake... Will get purged when we squash commits |
Woops I hadn't seen the update. This looks okay for zsh now, and yeah, feel free to remove that crashdump whenever. |
Did it. Now only documentation is missing. I'll document it in What will be the number of the next version? It would be nice to mention from which version |
I don't have an issue with that if you think it warrants the complexity. Having it in the commands for the list of arguments makes sense as well.
3.23, since this is going to be a new feature, we'll be able to go up a number regardless. |
Fixed. I'll ping you when I'll submit docs PR to rebar3.org repo. |
Provider to generate autocompletion files. Generates completion for plugins too, which is a big step forward! Previous completion also worked only for the first flag.
Currently only completion for
bash
is implemented. I'll first wait for comments on style/tests and then I'll implementzsh
and maybe others.Also, documentation is missing, but it will be written as soon as implementation gets reviewed and I manage to get some free time.
@ferd About testing, I did what I believe is convenient here - do you have more suggestions ? It ensures that file is written and that it contains some key parts such as function definition (loose regex) and completion definitions for "rebar3" and for all os-level aliases. I can't run a bash built-in (
source
) to run the completion function from CT...Closes #2077
EDIT:
#2754 can now be implemented as an oracle and it will be available in all supported shells! Actually, completion for
rebar3 as <profile>
andrebar3 clean --projects <project>
could be implemented with small modifications. Current completion forrebar3 as
is partly broken, so you can ignore it for now.