How to write test for LineMarkerProvider#collectSlowLineMarkers


I need to write test for LineMarkerProvider implementation, I found one example - org.jetbrains.plugins.groovy.lang.GroovyLineMarkerTest,
but it tests only markers that collected only by LineMarkerProvider#getLineMarkerInfo method.
I tried to find some example or flag in the com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl to enable collecting markers with collectSlowLineMarkers but didn't found yet.
Maybe someone know what should I do, or some example.

Thanks in advance!

Comment actions Permalink

Actually for tests, there should be no difference between the two line marker calculation passes. CodeInsightTestFixture.doHighlighting() runs all highlighting passes - both the one for fast line markers and the one for slow markers. And calling getLineMarkers() retrieves all line markers that have been set in the document.

Maybe your problem lies somewhere else?

Comment actions Permalink

Thanks Dmitry - you are absolutely right(as always).
I missed that the first line of method was:

if (ApplicationManager.getApplication().isUnitTestMode()) return;


Please sign in to leave a comment.