-
Notifications
You must be signed in to change notification settings - Fork 202
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 autocompletion with Bash and zsh #353
Conversation
WOW! This is wicked |
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.
🚀 Perfect PR, I only have one suggestion!
@@ -34,6 +34,14 @@ object Commands { | |||
@Recurse cliOptions: CliOptions = CliOptions.default | |||
) extends RawCommand | |||
|
|||
case class Completion( |
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.
Can we call this autocompletion
so that completion
doesn't conflict with compile
?
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 was gonna suggest the same, ideally there should be no conflicting tasks with test
and compile
to make c<TAB> => compile
and t<TAB> => test
completion work
This is my first feature written 100% with Bloop 😄 |
This allows to have bloop suggest completion when doing for instance: - bloop run frontend --main <tab> will suggest `bloop.Bloop`, bloop.Cli` and `bloop.Server` - bloop test frontend --filter <tab> should suggest `bloop.nailgun.BasicNailgunSpec` (and more), but this is not finished at the moment (pending some refactoring of test discovery)
This will make it easier to generate auto completion for them
0fe01e4
to
375ba62
Compare
I've just tried this out, it's awesome. Someone, in the future, should check whether we abide by the rules described in the zsh completions bible or not. https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide This is not a blocker for now, it works. I added the following to my
|
JUST RELEASE ALREADY WILL YA 😸 |
Waiting on a PR to update the docs and update the python script and we release M7 folks! 🎉 |
This adds a new command
completion
to bloop that takes care of providing autocompletion suggestions. The output is configured with--format
, so that it can be understood by different autocompletion engines.The suggestions for autocompletion depend on the context where they are applied: For instance, after a command, Bloop will suggest project names. If the command is
run
and the flag is--main
, Bloop will propose main classes.Currently Bloop will not suggest test names in (
test
,--filter
) because extracting the test names requires some refactoring that I've undertaken in my WIP to support Scala Native. I'll fix that later.The homebrew formula installs both autocompletions for Bash and zsh.