I write a inspection which depends on multiple PsiElements which can be located somewhere in the PsiFile/PsiClass.
It is something similar like the FieldCanBeLocalInspection.
So my inspection returns true in com.intellij.codeInspection.LocalInspectionTool#runForWholeFile
Register problem is not my problem. The problem is that already registered problems are not cleared when necessary.
I try to explain my inspection and use-case a bit more:
My inspection calls ProblemsHolder.registerProblem for a specific PsiJavaToken element (a simple string literal element)
because the word 'test' does not exist in the whole file (PsiFile/PsiClass).
Now, the user edits somewhere in the same file a javadoc (PsiComment) and writes the word 'test'.
The already registered problems must now be cleared.
How I am doing that?
Both PsiElements can be located in completely different locations.