com.intellij.lang.cacheBuilder.DefaultWordsScanner Java Examples

The following examples show how to use com.intellij.lang.cacheBuilder.DefaultWordsScanner. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NASMFindUsagesProvider.java    From JetBrains-NASM-Language with MIT License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(new NASMLexer(),
            TokenSet.create(NASMTypes.LBL),
            TokenSet.create(NASMTypes.COMMENT),
            TokenSet.EMPTY);
}
 
Example #2
Source File: OclFindUsagesProvider.java    From reasonml-idea-plugin with MIT License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    OclTypes types = OclTypes.INSTANCE;
    return new DefaultWordsScanner(
            new OclLexer(),
            TokenSet.create(types.C_UPPER_SYMBOL, types.C_LOWER_SYMBOL, types.C_VARIANT),
            TokenSet.EMPTY,
            TokenSet.EMPTY);
}
 
Example #3
Source File: RmlFindUsagesProvider.java    From reasonml-idea-plugin with MIT License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    RmlTypes types = RmlTypes.INSTANCE;
    return new DefaultWordsScanner(new RmlLexer(), TokenSet.create(types.C_UPPER_SYMBOL, types.C_LOWER_SYMBOL, types.C_VARIANT), TokenSet.EMPTY,
                                   TokenSet.EMPTY);
}
 
Example #4
Source File: SoyFindUsagesProvider.java    From bamboo-soy with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(
      new SoyLexer(),
      TokenSet.create(SoyTypes.IDENTIFIER_WORD),
      TokenSet.create(SoyTypes.COMMENT_BLOCK, SoyTypes.LINE_COMMENT),
      TokenSet.EMPTY);
}
 
Example #5
Source File: DotEnvFindUsagesProvider.java    From idea-php-dotenv-plugin with MIT License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(new DotEnvLexerAdapter(),
            TokenSet.create(DotEnvTypes.PROPERTY),
            TokenSet.create(DotEnvTypes.COMMENT),
            TokenSet.EMPTY);
}
 
Example #6
Source File: SQFFindUsagesProvider.java    From arma-intellij-plugin with MIT License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
	return new DefaultWordsScanner(
			new SQFLexerAdapter(),
			SQFParserDefinition.IDENTIFIERS,
			SQFParserDefinition.COMMENTS,
			SQFParserDefinition.NUMBER_LITERALS
	);
}
 
Example #7
Source File: ProtoFindUsagesProvider.java    From protobuf-jetbrains-plugin with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {

    return new DefaultWordsScanner(new ProtoLexerAdapter(),
            ProtoParserDefinition.IDENTIFIER_TOKEN_SET,
            ProtoParserDefinition.COMMENT_TOKEN_SET,
            ProtoParserDefinition.LITERAL_TOKEN_SET);
}
 
Example #8
Source File: BuildFindUsagesProvider.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(
      new BuildLexer(LexerMode.SyntaxHighlighting),
      tokenSet(TokenKind.IDENTIFIER),
      tokenSet(TokenKind.COMMENT),
      tokenSet(TokenKind.STRING));
}
 
Example #9
Source File: SQFFindUsagesProvider.java    From arma-intellij-plugin with MIT License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
	return new DefaultWordsScanner(
			new SQFLexerAdapter(),
			SQFParserDefinition.IDENTIFIERS,
			SQFParserDefinition.COMMENTS,
			SQFParserDefinition.NUMBER_LITERALS
	);
}
 
Example #10
Source File: HaskellFindUsagesProvider.java    From intellij-haskforce with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    // NOTE: Do not make this static! See https://github.com/carymrobbins/intellij-haskforce/issues/397
    // Second parameter is nodes that are PsiNamedElements in practice.
    return new DefaultWordsScanner(
        new HaskellSyntaxHighlightingLexer(),
        TokenSet.create(HaskellTypes.VARIDREGEXP, HaskellTypes.CONIDREGEXP),
        HaskellParserDefinition.COMMENTS, HaskellParserDefinition.STRINGS
    );
}
 
Example #11
Source File: GLSLFindUsagesProvider.java    From glsl4idea with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    /*
    This method must either return thread safe instance (which DefaultWordsScanner is not!)
    or a new instance. This is required, otherwise errors will happen.
     */
    return new DefaultWordsScanner(new GLSLFlexAdapter(),
            TokenSet.create(GLSLTokenTypes.IDENTIFIER),
            TokenSet.create(GLSLTokenTypes.COMMENT_LINE, GLSLTokenTypes.COMMENT_BLOCK),
            TokenSet.create(GLSLTokenTypes.PREPROCESSOR_STRING));
}
 
Example #12
Source File: CppFindUsagesProvider.java    From CppTools with Apache License 2.0 5 votes vote down vote up
@Nullable
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(
    new FlexAdapter(new _CppLexer(true, false, true, true, true)), // TODO: c/c++ dialects
    TokenSet.create(CppTokenTypes.IDENTIFIER),
    CppTokenTypes.COMMENTS,
    TokenSet.create(CppTokenTypes.STRING_LITERAL)
  );
}
 
Example #13
Source File: MakefileFindUsagesProvider.java    From CppTools with Apache License 2.0 5 votes vote down vote up
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(
    new FlexAdapter(new _MakefileLexer(true)),
    TokenSet.create(MakefileTokenTypes.IDENTIFIER, MakefileTokenTypes.TARGET_IDENTIFIER,
      MakefileTokenTypes.VAR_DEFINITION, MakefileTokenTypes.VAR_REFERENCE),
    MakefileTokenTypes.COMMENTS,
    MakefileTokenTypes.LITERALS
  );
}
 
Example #14
Source File: XQueryFindUsageProvider.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(new XQueryLexer(),
            TokenSet.EMPTY, XQueryParserDefinition.COMMENTS, XQueryParserDefinition.STRINGS);
}