diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractLineMarkersTest.kt b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractLineMarkersTest.kt index 41ec6286c35..38f29b7a352 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractLineMarkersTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractLineMarkersTest.kt @@ -45,34 +45,14 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase() fun doTest(path: String) = doTest(path) {} protected fun doAndCheckHighlighting( - documentToAnalyze: Document, expectedHighlighting: ExpectedHighlightingData, expectedFile: File + project: Project, + documentToAnalyze: Document, + expectedHighlighting: ExpectedHighlightingData, + expectedFile: File ): List> { myFixture.doHighlighting() - val markers = DaemonCodeAnalyzerImpl.getLineMarkers(documentToAnalyze, myFixture.project) - - try { - expectedHighlighting.checkLineMarkers(markers, documentToAnalyze.text) - - // This is a workaround for sad bug in ExpectedHighlightingData: - // the latter doesn't throw assertion error when some line markers are expected, but none are present. - if (FileUtil.loadFile(expectedFile).contains(" Unit) { @@ -92,7 +72,7 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase() PsiDocumentManager.getInstance(project).commitAllDocuments() - val markers = doAndCheckHighlighting(document, data, File(path)) + val markers = doAndCheckHighlighting(myFixture.project, document, data, File(path)) assertNavigationElements(myFixture.project, myFixture.file as KtFile, markers) additionalCheck() @@ -173,5 +153,37 @@ abstract class AbstractLineMarkersTest : KotlinLightCodeInsightFixtureTestCase() return expectedNavigationText } + + fun checkHighlighting( + project: Project, + documentToAnalyze: Document, + expectedHighlighting: ExpectedHighlightingData, + expectedFile: File + ): MutableList> { + val markers = DaemonCodeAnalyzerImpl.getLineMarkers(documentToAnalyze, project) + + try { + expectedHighlighting.checkLineMarkers(markers, documentToAnalyze.text) + + // This is a workaround for sad bug in ExpectedHighlightingData: + // the latter doesn't throw assertion error when some line markers are expected, but none are present. + if (FileUtil.loadFile(expectedFile).contains("> { + myFixture.doHighlighting() + + return AbstractLineMarkersTest.checkHighlighting(myFixture.project, documentToAnalyze, expectedHighlighting, expectedFile) + } + } \ No newline at end of file