How can I force the code analysis status icon to update?

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()?

1 comment
Comment actions Permalink

Hmmmm...never mind.  I decided to try a different approach and use a standard annotator instead of an external annotator.  I registered a listener with the file editor manager to determine when to register and unregister an interest in a file for external analysis.  The annotator just shows any existing warnings/errors from the external analyzer, and the external analyzer just runs in the background and notifies the monitored files that they need to run analysis again when it has something to report.  This seems to do exactly what I want!

1

Please sign in to leave a comment.