final int localStartOffset = textRange.getStartOffset();
String text;
EditorHighlighter highlighter;
if (consoleEditor instanceof EditorWindow) {
EditorWindow editorWindow = (EditorWindow) consoleEditor;
EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
PsiFile file = editorWindow.getInjectedFile();
final VirtualFile virtualFile = file.getVirtualFile();
assert virtualFile != null;
highlighter = HighlighterFactory.createHighlighter(virtualFile, scheme, getProject());
String fullText = InjectedLanguageUtil.getUnescapedText(file, null, null);
highlighter.setText(fullText);