Annotator problems after upgrade to 2017.1
Hi -
I am updating a plugin from 2016.3 to 2017.1.
I have an com.intellij.lang.annotation.Annotator extension which I can see is functioning properly by stepping through the code, and can see that it's calling com.intellij.lang.annotation.AnnotationHolder#createWarningAnnotation.
In the UI I can see that the annotation too.
My problem is in my test I check for the annotation being present by getting all annotations from the file: com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl#getHighlights. In 2016.3 this was returning the annotation, in 2017.1 it does not.
Any ideas?
请先登录再写评论。
No. Maybe you are asking the daemon too early? (Daemon should finish and com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl#isRunningOrPending should become false.
Or better yet, use OpenAPI like com.intellij.testFramework.fixtures.CodeInsightTestFixture which waits for daemon automatically)
Thanks... it's some kind of timing issue. isRunningOrPending never becomes false in that thread.
I don't really want to use the test cases, because (in another respect), getting the highlight info is the main reason for the plugin existing. If I run it in an invokeLater and sleep for a bit I get it. But something definitely changed since 16.3...