Unused symbol highlighting: Overridden by color theme?

Hi,
in a custom language plugin (Bash) I highlight unused symbols using an inspection
     holder.registerProblem(nameSymbol, getShortName(), ProblemHighlightType.LIKE_UNUSED_SYMBOL);

If the active color theme does specify a foreground color for functions then this color overrides the unused symbol color.

Is there a way to force the unused symbol format over whatever the theme specifies?

I've tried a PostHighlightingPass, but this seems to slowdown the editor a lot and I was unable to remove the unused symbol formatting once the function is used again.

Does someone know how to do this or maybe there's some code somewhere?

Thanks,
Wallaby

3 comments

How exactly do you highlight functions?

0

For function highlighting I use an annotator, the code which adds the function name highlighting is

        //inside of the Annotator's annonate method:
        Annotation annotation = annotationHolder.createInfoAnnotation(functionName, null);
        annotation.setTextAttributes(BashSyntaxHighlighter.FUNCTION_DEF_NAME);



The unused definition highlighting is added by an inspection (LocalInspectionTool) with this

     
holder.registerProblem(nameSymbol, getShortName(), ProblemHighlightType.LIKE_UNUSED_SYMBOL);
0

For function highlighting I use an annotator, the code which adds the function name highlighting is

        //inside of the Annotator's annonate method:
        Annotation annotation = annotationHolder.createInfoAnnotation(functionName, null);
        annotation.setTextAttributes(BashSyntaxHighlighter.FUNCTION_DEF_NAME);

The unused definition highlighting is added by an inspection (LocalInspectionTool) with this

     holder.registerProblem(nameSymbol, getShortName(), ProblemHighlightType.LIKE_UNUSED_SYMBOL);

---
Original message URL: http://devnet.jetbrains.net/message/5489581#5489581

0

Please sign in to leave a comment.