Vscode-java-test: Keyboard shortcut

Created on 18 Dec 2018  路  11Comments  路  Source: microsoft/vscode-java-test

I was able to configure a keyboard shortcut to run all project tests with the following configuration at keybindings.json.

(...)
 {
        "key": "ctrl+t",
        "command": "java.test.explorer.run",
        "when": "resourceLangId == java"
 }
(...)

But I want to be able to configure 2 more shortcuts to:

  1. Run all tests from the current file
  2. Run test from the current focused method

Is there a way to do so?

enhancement

Most helpful comment

@franciscocpg Unfortunately, there is no way to do this for now.

We will consider adding this support in the future.

All 11 comments

@franciscocpg Unfortunately, there is no way to do this for now.

We will consider adding this support in the future.

Would be also nice to be able to configure shortcut to re-run last "Run test" command

Would be also nice to be able to configure shortcut to re-run last "Run test" command

I'm considering writing a PR to do exactly this. Would the Test Runner team be open to a PR like that?

@JasonHenriksen All the contributions are welcome! Please go ahead!

Hi @JasonHenriksen, is everything works fine? Is there anything I can help with?

I've been busy with a time critical project, but I'm hoping to start writing a PR soon. I used to write a lot of eclipse plugins, but I haven't written a VS Code plugin yet. I'm looking forward to learning how!

Some new commands are introduced in the next release version 0.24.0, which you can set shortcuts for them:

  • Open the test report: java.test.show.report
  • Relaunch the test execution: java.test.relaunch

Hi, any idea when this could be implemented? I see it is in backlog, just asking if you are at least considering this in near future.

@baldimir The next release will have a new command to run the test in the current editing file. See: #1066

Thanks, so what is left is a command to run a specific test from a file.

New commands added in the 0.25.0 to run/debug the tests in current file:

  • java.test.editor.run
  • java.test.editor.debug
Was this page helpful?
0 / 5 - 0 ratings

Related issues

fbricon picture fbricon  路  5Comments

ashoknailwal picture ashoknailwal  路  8Comments

oakad picture oakad  路  9Comments

andifalk picture andifalk  路  9Comments

mccreery picture mccreery  路  4Comments