Highlight error only in a portion of a token

Answered

Here's a piece of code from a LocalInspection:

holder.registerProblem(new ProblemDescriptorImpl(element, element, "Suspicious Dollar", new LocalQuickFix[] {}, ProblemHighlightType.WEAK_WARNING, false, new TextRange(base + start, base + end), isOnTheFly));

As you can see, I'm giving a range for the problem. But still the whole token gets highlighted (underlined, here) in IJ. When I use "Run inspection by name" and double-click a result, the caret is positioned at the right place. Is there any way to highlight just the given text range (to make it ways easier for the user to understand where the issue is)?

 

Thanks!

1 comment
Comment actions Permalink

I'm must have stuffed up when testing. This actually works fine.

0

Please sign in to leave a comment.