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

9 comments
Comment actions Permalink

Where there is a similar example can also be

0
Comment actions Permalink

Hello Jin,

in what programming language?

xml?

1
Comment actions Permalink

yes,in xml language

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

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

oh,too difficutlt

0

Please sign in to leave a comment.