use of com.intellij.codeHighlighting.BackgroundEditorHighlighter in project intellij-community by JetBrains.
the class DomUIFactoryImpl method createDomHighlighter.
@Override
public BackgroundEditorHighlighter createDomHighlighter(final Project project, final PerspectiveFileEditor editor, final DomElement element) {
return new BackgroundEditorHighlighter() {
@Override
@NotNull
public HighlightingPass[] createPassesForEditor() {
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();
GeneralHighlightingPass ghp = new GeneralHighlightingPass(project, psiFile, document, 0, document.getTextLength(), true, new ProperTextRange(0, document.getTextLength()), null, new DefaultHighlightInfoProcessor());
LocalInspectionsPass lip = new LocalInspectionsPass(psiFile, document, 0, document.getTextLength(), LocalInspectionsPass.EMPTY_PRIORITY_RANGE, true, new DefaultHighlightInfoProcessor());
return new HighlightingPass[] { ghp, lip };
}
@Override
@NotNull
public HighlightingPass[] createPassesForVisibleArea() {
return createPassesForEditor();
}
};
}
Aggregations