Using the AsciiDoctor plugin in JetBrains MPS

As MPS is built upon the IntelliJ IDEA platform it supports many of the plugins that are supported in IntelliJ. Unfortunately some of these cannot be installed though the Marketplace directly. This also applies to the AsciiDoctor plugin. It is available in the marketplace, but does not feature the latest version there. Also when installing this plugin from the Marketplace it will throw some exceptions on startup. This is because it tries to tie actions to non-existing menus. Luckily there’s a workaround to be able to enjoy the AsciiDoctor plugin in MPS without errors.

Steps for using the currently latest version of the AsciiDoctor plugin (0.30.73) with MPS 2019.3.4.

Download the plugin.zip from the plugin site: https://plugins.jetbrains.com/plugin/7391-asciidoc/update/86351

Now we need to edit the plugin descriptor. This descriptor is located in asciidoctor-intellij-plugin/lib/asciidoctor-intellij-plugin.jar/META-INF/plugin.xml

In the plugin descriptor find the <idea-version> tag and update the since-build attribute to 193.1497, which is the build number of the forementioned MPS version.

Next we need to remove the <add-to-group> elements for actions that are being added to the RefactoringMenu group as that group does not exist in an MPS installation.

I forked the plugin on github and created a mps compatible release in which these changes already have been applied. It be downloaded here: https://github.com/uiterlix/asciidoctor-mps-plugin/releases/tag/0.30.77