How to intercept and process code nodes (syntax and highlight)
<root>
<code lang="java">
System.out.println("hello")
</code>
<code lang="javascript">
console.log('hello')
</code>
</root>
I learned that com.intellij.psi.PsiLanguageInjectionHost does not implement
请先登录再写评论。
Where there is a similar example can also be
Hello Jin,
in what programming language?
xml?
yes,in xml language
here is a file where you could start searching:
https://github.com/JetBrains/intellij-community/blob/master/xml/xml-psi-api/src/com/intellij/psi/xml/XmlFile.java
<code lang="java"> System.out.println("hello");//I want to use Java's highlighting and syntax checking here. </code>not sure if there is possibility to easily (automatically) mix different languages.
you may try to define your own language type, BNF syntax etc.
This is not simple.
Yes, I find some materials to study the BNF and the lexer related knowledge, but still can't understand. So did want to find a similar plug-in code learning how to learn. I have reviewed the angularjs, https://github.com/afelix/bemidea-bemhtml, https://github.com/afelix/bemidea-bemhtml, https://github.com/idok/react-templates-plugin, but it seems BNF or not. alas
here is very extensive example of working BNF:
https://github.com/ignatov/intellij-erlang/blob/master/grammars/erlang.bnf
It works very well.
This is not my plugin.
oh,too difficutlt