How to embed language for xml tag? Follow
Answered
I am maintaining a plug-in. One of the functions is to provide editing of the wxml file. This file is very similar to the xml file and contains many unique tags, but does not include the tags that come with html. I am currently looking for a way to embed js language in xml tags.
<wxs>
let a = 1;
class A {
}
class B {
}
</wxs>
Please sign in to leave a comment.
You should implement the <multiHostInjector> extension point to inject another language within the XML file. From JavaDocs:
Check the MultiHostInjector.java for more details.
Thanks you for your reply.
I use <multiHostInjector> solved this, But I have a question, in HtmlLexer, Why Html's <script> and <style> are implemented at the Lexer level
I guess because of the performance. In case you're not providing full language support but extending the existing one - it's required to go with injectors.