long (boolean checkWarnings, boolean checkInfos, boolean checkWeakWarnings, boolean checkSymbolNames) { PsiFile file = getFile(); KtFile ktFile = file instanceof KtFile ? (KtFile) file : null; String text = file.getText(); boolean suppressHighlight = InTextDirectivesUtils.isDirectiveDefined(text, "// " + SUPPRESS_HIGHLIGHTING_DIRECTIVE); return KotlinLightCodeInsightFixtureTestCaseKt .withCustomCompilerOptions(text, getProject(), getModule(), () -> { try { if (ktFile != null && ktFile.isScript() && myFixture instanceof JavaCodeInsightTestFixtureImpl) { ((JavaCodeInsightTestFixtureImpl) myFixture).canChangeDocumentDuringHighlighting(true); } if (suppressHighlight && ktFile != null) { ElementSelectionUtilsKt.selectElement(myFixture.getEditor(), ktFile, ElementKind.EXPRESSION, new Function1<PsiElement, Unit>() { @Override public Unit invoke(PsiElement element) { if (element instanceof KtElement) { AbstractKotlinHighlightVisitor.suppressHighlight((KtElement) element); } return Unit.INSTANCE; } }); } ExpectedHighlightingData data = new ExpectedHighlightingData( getEditor().getDocument(), checkWarnings, checkWeakWarnings, checkInfos, false); if (checkSymbolNames) { data.checkSymbolNames(); } data.init(); return ((JavaCodeInsightTestFixtureImpl)myFixture).collectAndCheckHighlighting(data); } catch (FileComparisonFailure e) { throw new FileComparisonFailure(e.getMessage(), e.getExpected(), e.getActual(), new File(e.getFilePath()).getAbsolutePath()); } }); }