blob: bb6a5d1807d91a5e5ebe60c8c82fc5b435167c32 [file] [log] [blame]
package com.intellij.psi.templateLanguages;
import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
import static com.intellij.psi.TokenType.BAD_CHARACTER;
/**
* @author peter
*/
public class TemplateDataHighlighterWrapper implements SyntaxHighlighter {
private final SyntaxHighlighter myHighlighter;
public TemplateDataHighlighterWrapper(SyntaxHighlighter highlighter) {
myHighlighter = highlighter;
}
@Override
@NotNull
public Lexer getHighlightingLexer() {
return myHighlighter.getHighlightingLexer();
}
@Override
@NotNull
public TextAttributesKey[] getTokenHighlights(final IElementType tokenType) {
if (tokenType == BAD_CHARACTER) {
return new TextAttributesKey[0];
}
return myHighlighter.getTokenHighlights(tokenType);
}
}