0

is there any possibility to start/run the MWE2 Workflow for generating the Xtext artifacts by a keyboard shortcut, especially under Mac OS X ? The only action I can see is via context menu / right mouse click on the mwe2 file. This action is listed afterwards as entry of the Run History, but there isn't any shortcut to start an entry from that Run history. The only way I've found is via the whole menu structure: Ctrl-F2 (focus on menu bar) / 'R' (focus the Run menu) / 5x arrow down (select 'Run History...') / 1x arrow right (open submenu) / starting the entry in run history. But that's IMO too much key strokes. Is there a simpler solution ?

Kind regards Dominik

Dominik
  • 1,332
  • 1
  • 15
  • 28

1 Answers1

0

SOLVED: Sebastian answer was correct ... but I found a solution which works perfect nevertheless. Remember, the goal was to hit a keyboard shortcut to generate the artifacts if you're in the editor containing the open grammar file. Then switch to the editor with the unit test of that grammar, hit another keystroke and perform that unit test(s).

Since a long time I've defined CMD-F12 as 'Rerun JUnit Test" in Preferences / General / Keys so the second goal is already reached: One can run all the JUnit tests defined in your xtend class by selecting the class name and hit Alt-CMD-X-T (Run as JUnit Test). After that, one can rerun that JUnit test with the key binding mentioned above.

In order to achieve the first goal (and this was the original reason for that question), I configured a Run/Debug launch configuration for the Xtext project itself ! Such a launch configuration can be used, if the file within the active editor can't run as something else (JUnit test, Java Application, Applet etc.) This behavior is controlled by Preferences / Run/Debug / Launching: there is an option for 'Launch the associated project' for 'if not launchable'. The Xtext grammar file within the active editor is 'not launchable'.

The project launch configuration is created as property of the project (right click the project or Alt-Enter on the selected project). There is a section "Run/Debug Settings" where one can create a new launch configuration for the project. Use the same values as the automatically created MWE2 launch configurations (see your Run Configurations...")

After these steps, one can switch between grammar editor and unit test file and use (Shift)CMD-F11 (Run/Debug) and CMD-F12 (Rerun JUnit Test) !

Dominik
  • 1,332
  • 1
  • 15
  • 28