if (psiFile != null) {
element = IdeaUtilImpl.getElementAtLine(psiFile, lineStart);
}
}
RangeMarker marker = null;
if (element != null) {
marker = document.createRangeMarker(element.getTextRange());
} else if (lineStart >= 0 && lineEnd >= 0) {
marker = document.createRangeMarker(document.getLineStartOffset(lineStart), document.getLineEndOffset(lineEnd));
}
if(marker != null) {
editor.getMarkupModel().addRangeHighlighter(marker.getStartOffset(), marker.getEndOffset(), HighlighterLayer.FIRST - 1, new TextAttributes(null, null, JBColor.RED, EffectType.BOXED, Font.BOLD), HighlighterTargetArea.EXACT_RANGE);
}
return editor;
}