BackgroundEditorHighlighter (final Project project, final PerspectiveFileEditor editor, final DomElement element) { return () -> { if (!element.isValid()) return HighlightingPass.EMPTY_ARRAY; final XmlFile psiFile = DomUtil.getFile(element); final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project); final Document document = psiDocumentManager.getDocument(psiFile); if (document == null) return HighlightingPass.EMPTY_ARRAY; editor.commit(); return TextEditorHighlightingPassRegistrarEx.getInstanceEx(project) .instantiateMainPasses(psiFile, document, new DefaultHighlightInfoProcessor()).toArray(HighlightingPass.EMPTY_ARRAY); }; }