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

1

Where there is a similar example can also be

0

Hello Jin,

in what programming language?

xml?

1

yes,in xml language

0
<code lang="java">
        System.out.println("hello");//I want to use Java's highlighting and syntax checking here.
</code>
1

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.

0

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

0

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. 

0

oh,too difficutlt

0

请先登录再写评论。