Search in sources :

Example 1 with CfmlLexer

use of com.intellij.coldFusion.model.lexer.CfmlLexer in project intellij-plugins by JetBrains.

the class CfscriptLexerTest method doTest.

private void doTest() throws IOException {
    Lexer lexer = new CfmlLexer(true, null);
    String testText = loadFile(getTestName(true) + ".test.cfml");
    doFileLexerTest(lexer, testText, getDataSubpath() + getTestName(true) + ".test.expected");
}
Also used : Lexer(com.intellij.lexer.Lexer) CfmlLexer(com.intellij.coldFusion.model.lexer.CfmlLexer) CfmlLexer(com.intellij.coldFusion.model.lexer.CfmlLexer)

Example 2 with CfmlLexer

use of com.intellij.coldFusion.model.lexer.CfmlLexer 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)

Example 3 with CfmlLexer

use of com.intellij.coldFusion.model.lexer.CfmlLexer in project intellij-plugins by JetBrains.

the class CfmlLexerTest method testLexerState.

public void testLexerState() {
    String charSequence = "component name=\"Foo\" {}";
    CfmlLexer lexer = new CfmlLexer(true, null);
    lexer.start(charSequence);
    IElementType tokenType = lexer.getTokenType();
    lexer.advance();
    lexer.start(charSequence);
    assertEquals(tokenType, lexer.getTokenType());
}
Also used : IElementType(com.intellij.psi.tree.IElementType) CfmlLexer(com.intellij.coldFusion.model.lexer.CfmlLexer)

Aggregations

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