Act after inspections have run (count inspection errors)
I want to see how many errors occured in a file and act upon any changes. How would I go about triggering code right after the inspections have run? I've looked into Annotator and LocalInspectionTool. I think I need access to the resulting ProblemsHolder to do so, but I'm not too sure where to start.
Please sign in to leave a comment.
What exacly do you want to accomplish? Inspections are rerun incrementally for changed parts of a file, and after an inspection run has completed, a ProblemHolder will not contain all the problems in a file.
Thanks again for your help Dmitry. As a personal challenge to get to know the IntelliJ API, I'm trying to create a plugin from this feature request I posted earlier:
https://youtrack.jetbrains.com/issue/WI-25253
I figured I would have to catch the appropriate error message through the inspection handling service. I thought I'd start by simply grabbing an error count. Are you saying what I'm trying to do is undoable, or am I looking in the wrong direction?
In general, there is no API to remove error highlighting or inspection markers produced by another plugin. Each plugin is in control of its own highlighting.
Too bad, but thanks for helping out Dmitry. I guess I'll have to wait for the feature to be added to the IDEs.