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

Feature request: Shortcuts #27

Open
josericardo opened this issue Apr 4, 2013 · 5 comments
Open

Feature request: Shortcuts #27

josericardo opened this issue Apr 4, 2013 · 5 comments

Comments

@josericardo
Copy link

Hi, the plugin is great. The only thing I miss are shortcuts. At least one for running the tests on the current open file. It's quite tedious to have to use the mouse every time I want to run the tests.

It would be awesome if there was also a shortcut to run the tests for the current file. The name of the test file could be defined by convention. Something like: CurrentClassTest.

Is it possible?

@stephenh
Copy link

+1. I'm addicted to the "Rerun Test" shortcut for JUnit tests. Would love to have something similar for ScalaTest.

@cheeseng
Copy link
Contributor

cheeseng commented Jun 6, 2014

agree, we should definitely add them.

@cfclrk
Copy link

cfclrk commented Feb 20, 2015

+1. I'm so used to mapping F12 to "Run JUnit Test". It would be super cool if I could do the same for ScalaTest.

@mo-seph
Copy link

mo-seph commented Jul 13, 2015

Yes, this would be really helpful

@SteveOnorato
Copy link

The fix for the basic launch shortcut commands is pretty simple.

I added this to plugin.xml:

  <extension point="org.eclipse.ui.commands">
      <command
            name="%ScalaTestDebugSuiteCommand.label"
            description="%ScalaTestDebugSuiteCommand.label"
            categoryId="org.eclipse.debug.ui.category.run"
            id="org.eclipse.shortcut.scalatest.suite.debug">
      </command>
      <command
            name="%ScalaTestDebugTestCommand.label"
            description="%ScalaTestDebugTestCommand.label"
            categoryId="org.eclipse.debug.ui.category.run"
            id="org.eclipse.shortcut.scalatest.test.debug">
      </command>
      <command
            name="%ScalaTestDebugFileCommand.label"
            description="%ScalaTestDebugFileCommand.label"
            categoryId="org.eclipse.debug.ui.category.run"
            id="org.eclipse.shortcut.scalatest.file.debug">
      </command>
      <command
            name="%ScalaTestDebugPackageCommand.label"
            description="%ScalaTestDebugPackageCommand.label"
            categoryId="org.eclipse.debug.ui.category.run"
            id="org.eclipse.shortcut.scalatest.package.debug">
      </command>
      <command
            name="%ScalaTestRunSuiteCommand.label"
            description="%ScalaTestRunSuiteCommand.label"
            categoryId="org.eclipse.debug.ui.category.run"
            id="org.eclipse.shortcut.scalatest.suite.run">
      </command>
      <command
            name="%ScalaTestRunTestCommand.label"
            description="%ScalaTestRunTestCommand.label"
            categoryId="org.eclipse.debug.ui.category.run"
            id="org.eclipse.shortcut.scalatest.test.run">
      </command>
      <command
            name="%ScalaTestRunFileCommand.label"
            description="%ScalaTestRunFileCommand.label"
            categoryId="org.eclipse.debug.ui.category.run"
            id="org.eclipse.shortcut.scalatest.file.run">
      </command>
      <command
            name="%ScalaTestRunPackageCommand.label"
            description="%ScalaTestRunPackageCommand.label"
            categoryId="org.eclipse.debug.ui.category.run"
            id="org.eclipse.shortcut.scalatest.package.run">
      </command>
      
      <keyBinding
            keySequence="M3+M2+X F"
            contextId="org.eclipse.ui.globalScope"
            commandId="org.eclipse.shortcut.scalatest.file.run"
            keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
      </keyBinding>
  </extension>

(Only added one keyBinding as an example. Not sure what keySequences will avoid stepping on other plugins. In any case, now that the rest of the commands are defined, users can make their own mappings under General > Keys).

Added to plugin.properties:

ScalaTestDebugSuiteCommand.label = Debug ScalaTest - Suite
ScalaTestDebugTestCommand.label = Debug ScalaTest - Test
ScalaTestDebugFileCommand.label = Debug ScalaTest - File
ScalaTestDebugPackageCommand.label = Debug ScalaTest - Package
ScalaTestRunSuiteCommand.label = Run ScalaTest - Suite
ScalaTestRunTestCommand.label = Run ScalaTest - Test
ScalaTestRunFileCommand.label = Run ScalaTest - File
ScalaTestRunPackageCommand.label = Run ScalaTest - Package

I just modified the org.scala-ide.sdt.scalatest_2.10.0.v-4-2_11-201603171205-8ee752f.jar in my eclipse plugins directory, so I'm happy now. Is anybody still active here and wants to make the change to the repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants