how to highlight file in project tree


i have seen some posts about this but no answers. I implemented a custom inspection. I want to also highlight file in project tree like an annotator does. 

An annotator highlights Main like in screenshot but a localinspection does not. how can i make it happen with local inspection tool?

Thanks in advance


Comment actions Permalink

I solved it with annotator. I get current highlightSeverity of my inspection from current inspection profile inside annotator. so that my inspection and annotator have the same settings. My inspection core inside inspection will be run only if it is not onTheFly. annotator and inspection have the same core.

Thanks anyway

Comment actions Permalink

It would have been better if you could have posted a code block .


Tabi eger zamanin varsa. Tesekkurler.

Comment actions Permalink

Unfortunately I am not allowed to share the code in public because it was a project at the company.

But I can tell you in detail. I could not find a way to highlight the file in project explorer with my custom inspection. So I decided to use a custome annotator because annotators can highlight the file automatically if there is an error in file. This way I had an annotator which runs on the fly, and inspection, which runs only trigger manually. I configured the inspection not to run on the fly. I synced the settings of annotator with the ones of inspection. So that the severity could be changed or the annotator could be deactivated with user settings. I could not find a way to disable annotator with user interaction like for inspections. For the sync I used the class ProfileManager(not sure about the name) in IntelliJ. This is the main class which manages settings. So that I could get the settings of inspection and set the same severity in annotator. 

I could not find a doc about that at that time. I made assumptions and seached for the candidate classes. I tried all the candidates and many methods. After those I found the right ones. I hope this helps you in your work.


Please sign in to leave a comment.