Updating outdated annotations


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?


Hi Jerome,

File A editor should be handled automatically when you edit file B. Is there anything non-standard in your Annotator implementation? Maybe there is some issue logged in idea.log file?


Thanks Karol. Knowing what the expected behavior is helped me find what my mistake was!


Please sign in to leave a comment.