Plugin Dev help: I need to highlight the keyword in comment, where exist in *.vue, *,js *.ts

When I followed  the  PSI docoment introduction to develop my plugin , Noting working, I Don't known how to config my plugin.xml or what .java files that i need to implement.

plugin.xml 's extensions :

 

 <annotator language="" implementationClass="com.github.xxx.uniappmacrosupport.annotation.ConditionalCompilationAnnotator"/>
        <lang.foldingBuilder language="" implementationClass="com.github.xxx.uniappmacrosupport.folding.ConditionalCompilationFoldingBuilder" />

 

0
4 comments

Can you please provide an example of code you want to highlight? You can follow these steps, or use the following code in your annotator

 holder.newSilentAnnotation(HighlightSeverity.TEXT_ATTRIBUTES)
.textAttributes(SimpleSyntaxHighlighter.KEYWORD)
.range()
.create()
1

// ifdef Apple
const a = 123
// endif

i want to highlight the ifdef and endif in comment line

0

Then you need to use the second approach with an annotator. The first one is to highlight the whole token.

0

thanks for your help , it works,  it was some mistakes  in my previous code.

0

Please sign in to leave a comment.