ExternalAnnotator not updating the red/green/yellow square/checkmark in upper right corner of the editor

I wrote my ExternalAnnotator that looks very similar to this: https://github.com/antlr/jetbrains-plugin-sample/blob/master/src/java/org/antlr/jetbrains/sample/SampleExternalAnnotator.java

The annotator works; however, the icon at the top right of the editor (what is it called btw?) is not updated until I either save the file or hover over the icon. How do I fix that?

Thank you!

9 comments
Comment actions Permalink

user can configure their settings:

 

Appearance & Behaviour

 System Settings

  Save files automatically if application is idle for .. seconds

0
Comment actions Permalink

That's a solution, though perhaps less than ideal. Can I set it programmaticallu?

0
Comment actions Permalink

it is probably not good to set it programmatically. Users may prefer to auto save or save manually each time.

Let the users decide if they want the files to be auto saved, and how often.

You could remind users about this setting. Let them decide.

0
Comment actions Permalink

Is there a way to fix it short of autosaving?

0
Comment actions Permalink

try 

DaemonCodeAnalyzer.getInstance(project).restart();
0
Comment actions Permalink

Won't this restart the whole annotator? My annotator seems to work fine, I simply need to update the small square icon in the top right of the editor window above the scrollbar once the external annotator is finished, to reflect the results of the latest annotation. (What's the name of this icon, and why does not it update automatically?)

 

0
Comment actions Permalink

Hi,

How do you run the external annotator? If it's registered for language, then the results must be applied in the ExternalTooPass:

com.intellij.codeInsight.daemon.impl.ExternalToolPass#applyInformationWithProgress. Do you get your results applied to the editor? I don't see where the traffic light is repainted (as this part com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass#doApplyInformationToEditor is done before external annotator is ready) so most probably it's the bug in the system. Could you please recheck the part I mentioned above with the annotator itself?

Thanks,

Anna

0
Comment actions Permalink

Thank you Anna, I'll check and get back to you. So "traffic light" is the name? I've also come across the name "Content analysis marker", is it the same thing?

0
Comment actions Permalink

Traffic light is the name for the square in the right upper corner which shows the error status. Markers are used everywhere, I don't know what this one is though. They are not the same, I suppose.

0

Please sign in to leave a comment.