use of com.intellij.openapi.fileTypes.PlainSyntaxHighlighter in project intellij-community by JetBrains.
the class TemplateEditorUtil method setHighlighter.
private static void setHighlighter(EditorEx editor, @Nullable SyntaxHighlighter highlighter) {
EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
LayeredLexerEditorHighlighter layeredHighlighter = new LayeredLexerEditorHighlighter(new TemplateHighlighter(), editorColorsScheme);
layeredHighlighter.registerLayer(TemplateTokenType.TEXT, new LayerDescriptor(ObjectUtils.notNull(highlighter, new PlainSyntaxHighlighter()), ""));
editor.setHighlighter(layeredHighlighter);
}
use of com.intellij.openapi.fileTypes.PlainSyntaxHighlighter in project intellij-community by JetBrains.
the class LanguagePanel method updateHighlighters.
void updateHighlighters() {
final EditorImpl editor = ((EditorImpl) myPrefix.getEditor());
if (editor == null)
return;
final EditorImpl editor2 = ((EditorImpl) mySuffix.getEditor());
assert editor2 != null;
final Language language = InjectedLanguage.findLanguageById(getLanguage());
if (language == null) {
editor.setHighlighter(new LexerEditorHighlighter(new PlainSyntaxHighlighter(), editor.getColorsScheme()));
editor2.setHighlighter(new LexerEditorHighlighter(new PlainSyntaxHighlighter(), editor.getColorsScheme()));
} else {
final SyntaxHighlighter s1 = SyntaxHighlighterFactory.getSyntaxHighlighter(language, myProject, null);
final SyntaxHighlighter s2 = SyntaxHighlighterFactory.getSyntaxHighlighter(language, myProject, null);
editor.setHighlighter(new LexerEditorHighlighter(s1, editor.getColorsScheme()));
editor2.setHighlighter(new LexerEditorHighlighter(s2, editor2.getColorsScheme()));
}
}
Aggregations