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

Implement test autocompletion for bash/zsh/fish #749

Merged
merged 5 commits into from
Dec 27, 2018

Conversation

tanishiking
Copy link
Contributor

@tanishiking tanishiking commented Dec 5, 2018

This PR enables

  • bloop server to respond tests FQCN in a project to a testsfqcn autocomplete request like bloop autocomplete --format <shell> --mode testsfqcn --project <project>
  • bash/zsh/fish to autocomplete test names after bloop test <project> --only
Here are demos

zsh

asciicast

(in this video, autocompletion transformed the command from bloop to blobloop, but this is not actually happening..., I think this is a problem of asciinema and my zsh configuration...)

bash

asciicast

fish

asciicast

@tanishiking tanishiking force-pushed the test-autocompletion branch 2 times, most recently from 26cdfa9 to 8deccc2 Compare December 5, 2018 17:19
@@ -275,10 +275,13 @@ object Interpreter {
completion <- cmd.format.showMainName(main)
} state.logger.info(completion)
case Mode.TestsFQCN =>
import ExecutionContext.scheduler
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which scheduler should we use here...

@tanishiking tanishiking force-pushed the test-autocompletion branch 4 times, most recently from 801f800 to a7f257e Compare December 6, 2018 11:19
@jvican
Copy link
Contributor

jvican commented Dec 6, 2018

Nice! @tanishiking Will have a look at this next Monday since i'm in vacation for some days, thanks for the new tests 😄

tanishiking and others added 5 commits December 27, 2018 01:08
…ject <project>`

This commit enable bloop to return testsFQCN in a project
using `bloop autocomplete --format <shell> --mode testsfqcn --project <project>`.

scalacenter#426
We reuse the scheduler that the interpreter runs instead of hardcoding
it in the autocompletions engine. Besides, this commit makes some
stylistic changes to the code.
@jvican jvican force-pushed the test-autocompletion branch from a7f257e to 83af9ca Compare December 27, 2018 00:33
@jvican jvican added enhancement cli ergonomics Any change that affects developer ergonomics and the easiness of use of bloop. labels Dec 27, 2018
Copy link
Contributor

@jvican jvican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanishiking Thank you 🙏 I'm sorry for the delay in this PR, I removed the hardcoded ExecutionContext.scheduler by turning everything into a task and letting the scheduler of the interpreter be the one running the autocompletion task. The rest of the PR LGTM! 😄 This enhancement will be available in the upcoming 1.2.0.

@jvican jvican merged commit 6d8e092 into scalacenter:master Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement ergonomics Any change that affects developer ergonomics and the easiness of use of bloop.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants