List<HighlightInfo> (Editor editor, Project project) { FileDocumentManager.getInstance().saveAllDocuments(); // to avoid async document changes on automatic save during highlighting PsiDocumentManager.getInstance(project).commitAllDocuments(); PsiUtilBase.assertEditorAndProjectConsistent(project, editor); PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); PsiTestUtil.checkStubsMatchText(file); String text = editor.getDocument().getText(); try { Ref<List<HighlightInfo>> infos = Ref.create(); MadTestingUtil.prohibitDocumentChanges( () -> infos.set(CodeInsightTestFixtureImpl.instantiateAndRun(file, editor, new int[0], true))); return infos.get(); } catch (Throwable e) { LOG.debug("Exception occurred during highlighting in " + editor.getDocument() + ", text before:\n" + text); throw e; } }