rebar3
rebar3 copied to clipboard
completion provider
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 implement zsh
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>
and rebar3 clean --projects <project>
could be implemented with small modifications. Current completion for rebar3 as
is partly broken, so you can ignore it for now.
Also, I use maps:groups_from_list/2
which is introduced in OTP 25.0, is that a problem?
Also, I use
maps:groups_from_list/2
which is introduced in OTP 25.0, is that a problem?
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.
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 zsh
before merging this.
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 commands
section. Is it worth to move instructions on how to set up autocomplete to another section (probably in tutorials)? Because I don't wanna bloat commands
page with setup instructions that might grow with different shells being supported.
What will be the number of the next version? It would be nice to mention from which version completion
command became available
Did it. Now only documentation is missing. I'll document it in
commands
section. Is it worth to move instructions on how to set up autocomplete to another section (probably in tutorials)? Because I don't wanna bloatcommands
page with setup instructions that might grow with different shells being supported.
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.
What will be the number of the next version? It would be nice to mention from which version
completion
command became available
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.