This plug-in currently supports:
- Syntax highlighting
- Collapsible code blocks for workflows, tasks, and more.
- Highlighting and completion of parentheses
()
and other braces. - Allows auto-commenting of lines in WDL with CMD+/
- Undeclared value detection
- "Go to declaration"
More features will be coming soon!
The plugin is now part of the IntelliJ Plugin Repository. To install:
- Open the IntelliJ Preferences page
- Click on "Plugins"
- Click on "Browse Repositories "
- Search for and install "Winstanley WDL"
To build or test the plugin using IntelliJ:
- Get set up with the pre-requisites listed here: http://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/prerequisites.html
- Import this repo into IntelliJ as an existing project ("Import Project" on the initial screen).
- Accept all of the defaults in the import wizard
- When prompted to overwrite or reuse the module definition file
winstanley.iml
, you must select "Reuse"
- Make sure the repo is using the IntelliJ plugin Java SDK
- Project Structure -> Project -> Project SDK
- Make sure the repo has a valid Scala SDK attached as a project dependency
- (Project Structure -> Libraries -> "+" -> Scala SDK)
- Otherwise you'll see errors like
"Cannot find class WdlElementType"
even though it's clearly there!
- Generate the necessary files (on Mac):
- Navigate to Wdl.flex and generate sources using CMD+SHIFT+G.
- You may be prompted to choose a destination for the generated sources. If
/$PROJECT_ROOT/gen
doesn't exist, create it. Choose/$PROJECT_ROOT/gen
as the destination.
- You may be prompted to choose a destination for the generated sources. If
- Navigate to wdl.bnf and generate sources using CMD+SHIFT+G
- It may be necessary to right click on the
gen
folder and selectMark Directory As>Generated Sources Root
- That keyboard shortcut may be stolen by “Find Previous”, nuke it in Preferences -> Keymap and generation will start working
- Navigate to Wdl.flex and generate sources using CMD+SHIFT+G.
- At this point, you can run or test the project using IntelliJ's preset run modes.
- Open the
Run Configurations
window (for me, in the top right of the IntelliJ window) - Add a new one configuration with the
+
icon. - Choose the '
Plugin
' type. The defaults should be good.- Note that IntelliJ may hide
Plugin
in theXX items more (irrelevant)...
section at the end.
- Note that IntelliJ may hide
- When this new
Run Configuration
is run, a new IntelliJ window opens with the plugin preinstalled ready for testing. - Additional instructions for setting this up are in the IntelliJ links above.
- If you see the message "No plugin module specified for configuration", locate the dropdown "Use classpath of
module" and select "winstanley"
- If there are no entries in the dropdown, this may be because in Project Structure, the
winstanley
module is of type Java (folder with blue square) instead of IntelliJ Platform Plugin (power plug). You can correct this by removing the Java module and replacing it with a new IPP module.
- If there are no entries in the dropdown, this may be because in Project Structure, the
- If you kill the new IntelliJ window with the "stop" button, you will see the first launch screen every time; quit the application instead.
- Open the
The plug-in was created based on the instructions here: http://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support_tutorial.html