Search in sources :

Example 1 with HtmlHighlightingLexer

use of com.intellij.lexer.HtmlHighlightingLexer in project intellij-plugins by JetBrains.

the class CfmlIndexPatternBuilder method getIndexingLexer.

public Lexer getIndexingLexer(@NotNull final PsiFile file) {
    if (file instanceof CfmlFile) {
        Project project = file.getProject();
        SqlLanguageDialect dialect = SqlDialectMappings.getMapping(project, file.getVirtualFile());
        Lexer sqlLexer = LanguageParserDefinitions.INSTANCE.forLanguage(dialect).createLexer(project);
        LayeredLexer cfmlLayeredLexer = new LayeredLexer(new CfmlLexer(true, project));
        cfmlLayeredLexer.registerLayer(new HtmlHighlightingLexer(), CfmlElementTypes.TEMPLATE_TEXT);
        cfmlLayeredLexer.registerLayer(sqlLexer, CfmlElementTypes.SQL);
        return cfmlLayeredLexer;
    }
    return null;
}
Also used : Project(com.intellij.openapi.project.Project) Lexer(com.intellij.lexer.Lexer) HtmlHighlightingLexer(com.intellij.lexer.HtmlHighlightingLexer) CfmlLexer(com.intellij.coldFusion.model.lexer.CfmlLexer) LayeredLexer(com.intellij.lexer.LayeredLexer) CfmlFile(com.intellij.coldFusion.model.files.CfmlFile) HtmlHighlightingLexer(com.intellij.lexer.HtmlHighlightingLexer) LayeredLexer(com.intellij.lexer.LayeredLexer) CfmlLexer(com.intellij.coldFusion.model.lexer.CfmlLexer) SqlLanguageDialect(com.intellij.sql.dialects.SqlLanguageDialect)

Aggregations

CfmlFile (com.intellij.coldFusion.model.files.CfmlFile)1 CfmlLexer (com.intellij.coldFusion.model.lexer.CfmlLexer)1 HtmlHighlightingLexer (com.intellij.lexer.HtmlHighlightingLexer)1 LayeredLexer (com.intellij.lexer.LayeredLexer)1 Lexer (com.intellij.lexer.Lexer)1 Project (com.intellij.openapi.project.Project)1 SqlLanguageDialect (com.intellij.sql.dialects.SqlLanguageDialect)1