JB Markdown Plugin: Extend fenced code block language identifiers

Answered

Preface: I created a minimal example for this problem

I want to adjust the "language identifiers" that are used to recognize my language in fenced code blocks when writing markdown with the JB Markdown Plugin

```lang
code
```

 

The Markdown plugin provides an EP for this called CodeFenceLanguageProvider.

Therefore, I added the MD plugin to my gradle build file

configure<org.jetbrains.intellij.IntelliJPluginExtension> {
version = "LATEST-EAP-SNAPSHOT"
downloadSources = true
pluginName = "Wolfram-Language"
sameSinceUntilBuild = false
updateSinceUntilBuild = true
setPlugins("org.intellij.plugins.markdown:191.5109.14")
}

I added an optional dependency in my plugin.xml

<depends optional="true" config-file="withMarkdown.xml">org.intellij.plugins.markdown</depends>

and filled the config-file with what I believe is useful content

<idea-plugin>
<extensions defaultExtensionNs="org.intellij.plugins.markdown">
<fenceLanguageProvider implementation="de.halirutan.mathematica.lang.WLCodeFenceLanguageProvider"/>
</extensions>
</idea-plugin>

Everything compiles but I cannot get it to work. Additionally, IDEA always highlights the fenceLanguageProvider as red and I don't get any completion inside the extensions tags. The definition of the EP inside the MD plugin.xml is

<extensionPoint qualifiedName="org.intellij.markdown.codeFencePluginGeneratingProvider"
interface="org.intellij.plugins.markdown.extensions.MarkdownCodeFencePluginGeneratingProvider" />

I must be doing something basically wrong because even when I set a breakpoint in the markdown code at e.g. org.intellij.plugins.markdown.injection.LanguageGuesser#guessLanguage I don't get a hit when debugging.

The IntelliJ SDK Docs are pretty detailed about this and still, I'm unable to get it going. I "grep"-ed through the whole community sources but it seems no one used this EP. Can someone give me a pointer in the right direction?

 

Edit: Fixed typo

0
1 comment

Update:

It works exactly as I describe above. After closing everything and re-opening it, IDEA finally decided that I had suffered enough and simply worked. 

1

Please sign in to leave a comment.