MarkupModel - navigate highlighted elements

Hi

I use the MarkupModel to highlight some (Psi) elements. Everything works fine so far, but now I'm stuck on a) how to remove the highlighting once the user preses ESC and b) moving to the next highlighted element after pressing F3 (analogous to the IDEA default behavior).

Could anybody give me some hints on how I can achieve this? Or is there a higher-level API than the MarkupModel to get the described behavior "for free"?

Thanks in advance for any help!

etienne

0
6 comments

If I understand you correctly, I would use something like this:



Bas

0

Hi Bas

Beautiful! As always with your replies, it's exactly what I was looking for (using the MarkupModel was too low-level, I guess).

Thanks very much for the quick help.

etienne

P.S. If I ever get to meet you, I'll buy you a beer, or actually no - a case of beer would be more appropriate ;)

0
Avatar
Permanently deleted user

You know how to ask the right questions. Exactly the kind I have answers
for. I'm looking forward to that beer already:-)

Bas

0

Looks like the code example has disappeared in the mists of time. Does anyone have a current example?

4
Avatar
Permanently deleted user

This is linked in the dev guide FAQ. It seems to be a 13 year old thread though. I would also love to see this code example.

1

com.intellij.codeInsight.highlighting.HighlightUsagesHandlerBase

1

Please sign in to leave a comment.