I have an Annotator that uses knowledge from the whole project to annotate a file A that is currently visible. Then the user switches to file B, and the Annotator is called on file B. When the user modifies file B, the Annotator is called on file B, and annotations can be updated. But when the user goes back to file A, the Annotator is not called, and some of the annotations in file A are outdated due to the changes in file B.
Is there a way to mark a PsiFile or a PsiElement as outdated from an annotation point of view? Or is there another way to achieve this goal?