How to trigger ExternalAnnotator running immediately after saving the code change?

Answered
I have recently developed the "Protocol Buffer Linter Plugin".
 
 
It works well but sometimes not because ExternalAnnotator seems to be triggered stably.
 
The reproducible steps are below.
 
1. Change the code so that the plugin shows a warning.
2. Fix the code.
3. You expect that the plugin clears a warning. But under the hood, ExternalAnnotator is often not triggered.
4. After saving some changes a couple of times, ExternalAnnotator starts running.
0
4 comments

External Annotator is run with scheduled delay only. You can debug com.intellij.codeInsight.daemon.impl.ExternalToolPassFactory#createHighlightingPass and see whether detection of modification was really not the case.

0

Thank you for that quick reply.

I'll give it a try.

0

Thanks to your debug advice, I found out that my problem is the same with other tickets below.

 

- [How to run ExternalAnnotator right after PsiFile is committed to disk? – IDEs Support (IntelliJ Platform) | JetBrains](https://intellij-support.jetbrains.com/hc/en-us/community/posts/207042115-How-to-run-ExternalAnnotator-right-after-PsiFile-is-committed-to-disk-)
- [Only trigger externalAnnotator when the file system is in sync – IDEs Support (IntelliJ Platform) | JetBrains](https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000337510-Only-trigger-externalAnnotator-when-the-file-system-is-in-sync)

 

I fixed the issue so that the plugin's responsiveness and correctness are significantly improved.

 

- ref. https://github.com/yoheimuta/intellij-protolint/pull/1/commits/16213ade423ea5df5d351f06c0f1b42a196593fb

 

Thank you!

1

Please sign in to leave a comment.