I've implemented an external annotator for my custom language plugin that uses an external service to perform more rigorous analysis of the local source code asyncronously. While external annotators operate on single files per-invocation, this external service analyzes all files of which its aware and returns warning/error information for all that have issues.
When the external annotator runs, I just register the file with the external analyzer which fires off a new run in the background. I then check to see if there are any existing warnings/errors from the most recent analysis that need to be added as annotations and move on. When the asynchronous code analyzer completes, I store the errors for each file that had issues and call DaemonCodeAnalyzer.restart() on each processed file to force analysis again. In open editors this shows the annotations, and in files with annotations that aren't open, it ensures analysis the next time they're opened again.
The issue I'm seeing is that the analysis status icon in the top-righ corner of the editor window doesn't update. When errors are added, I can see them and navigate to them with Next/Previous Highlighted Error, but until I actually do something in the editor to force analysis, the icon is out of sync. Similar when an edit fixes the errors...I see the annotation disappear in the editor but error icon is still shown in the top-right.
Is there some other way to force a more full analysis that will update the icon as well? Am I perhaps not calling DaemonCodeAnalyzer.restart() properly()?