当前位置: 首页>>代码示例>>Java>>正文


Java TokenSet.orSet方法代码示例

本文整理汇总了Java中com.intellij.psi.tree.TokenSet.orSet方法的典型用法代码示例。如果您正苦于以下问题:Java TokenSet.orSet方法的具体用法?Java TokenSet.orSet怎么用?Java TokenSet.orSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.tree.TokenSet的用法示例。


在下文中一共展示了TokenSet.orSet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCommentTokenSet

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@Override
public TokenSet getCommentTokenSet(@NotNull final PsiFile file) {
  final JspFile jspFile = JspPsiUtil.getJspFile(file);
  TokenSet commentTokens = TokenSet.orSet(JavaIndexPatternBuilder.XML_COMMENT_BIT_SET, StdTokenSets.COMMENT_BIT_SET);
  final ParserDefinition parserDefinition =
    LanguageParserDefinitions.INSTANCE.forLanguage(jspFile.getViewProvider().getTemplateDataLanguage());
  if (parserDefinition != null) {
    commentTokens = TokenSet.orSet(commentTokens, parserDefinition.getCommentTokens());
  }
  return commentTokens;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JspIndexPatternBuilder.java

示例2: getCommentTokenSet

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@Override
@Nullable
public TokenSet getCommentTokenSet(@NotNull final PsiFile file) {
  if (file instanceof PsiJavaFile && !(file instanceof ServerPageFile)) {
    return TokenSet.orSet(StdTokenSets.COMMENT_BIT_SET, XML_COMMENT_BIT_SET, JavaDocTokenType.ALL_JAVADOC_TOKENS, XML_DATA_CHARS);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaIndexPatternBuilder.java

示例3: addTokenTypesForLanguage

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
private static TokenSet addTokenTypesForLanguage(FindModel model, Language lang, TokenSet tokensOfInterest) {
  ParserDefinition definition = LanguageParserDefinitions.INSTANCE.forLanguage(lang);
  if (definition != null) {
    tokensOfInterest = TokenSet.orSet(tokensOfInterest, model.isInCommentsOnly() ? definition.getCommentTokens(): TokenSet.EMPTY);
    tokensOfInterest = TokenSet.orSet(tokensOfInterest, model.isInStringLiteralsOnly() ? definition.getStringLiteralElements() : TokenSet.EMPTY);
  }
  return tokensOfInterest;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FindManagerImpl.java

示例4: PythonDialectsTokenSetProvider

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
private PythonDialectsTokenSetProvider() {
  TokenSet stmts = TokenSet.EMPTY;
  TokenSet exprs = TokenSet.EMPTY;
  TokenSet definers = TokenSet.EMPTY;
  TokenSet keywords = TokenSet.EMPTY;
  TokenSet parameters = TokenSet.EMPTY;
  TokenSet functionDeclarations = TokenSet.EMPTY;
  TokenSet recoveryTokens = TokenSet.EMPTY;
  TokenSet referenceExpressions = TokenSet.EMPTY;
  for(PythonDialectsTokenSetContributor contributor: Extensions.getExtensions(PythonDialectsTokenSetContributor.EP_NAME)) {
    stmts = TokenSet.orSet(stmts, contributor.getStatementTokens());
    exprs = TokenSet.orSet(exprs, contributor.getExpressionTokens());
    definers = TokenSet.orSet(definers, contributor.getNameDefinerTokens());
    keywords = TokenSet.orSet(keywords, contributor.getKeywordTokens());
    parameters = TokenSet.orSet(parameters, contributor.getParameterTokens());
    functionDeclarations = TokenSet.orSet(functionDeclarations, contributor.getFunctionDeclarationTokens());
    recoveryTokens = TokenSet.orSet(recoveryTokens, contributor.getUnbalancedBracesRecoveryTokens());
    referenceExpressions = TokenSet.orSet(referenceExpressions, contributor.getReferenceExpressionTokens());
  }
  myStatementTokens = stmts;
  myExpressionTokens = exprs;
  myNameDefinerTokens = definers;
  myKeywordTokens = keywords;
  myParameterTokens = parameters;
  myFunctionDeclarationTokens = functionDeclarations;
  myUnbalancedBracesRecoveryTokens = recoveryTokens;
  myReferenceExpressionTokens = referenceExpressions;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:PythonDialectsTokenSetProvider.java

示例5: getWhitespaceTokens

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@NotNull
@Override
public TokenSet getWhitespaceTokens() {
  return TokenSet.orSet(super.getWhitespaceTokens(), TokenSet.create(PyDocstringTokenTypes.DOTS));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:PyDocstringParserDefinition.java

示例6: PythonParserDefinition

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
public PythonParserDefinition() {
  myWhitespaceTokens = TokenSet.create(PyTokenTypes.LINE_BREAK, PyTokenTypes.SPACE, PyTokenTypes.TAB, PyTokenTypes.FORMFEED);
  myCommentTokens = TokenSet.create(PyTokenTypes.END_OF_LINE_COMMENT);
  myStringLiteralTokens = TokenSet.orSet(PyTokenTypes.STRING_NODES, TokenSet.create(PyElementTypes.STRING_LITERAL_EXPRESSION));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:PythonParserDefinition.java


注:本文中的com.intellij.psi.tree.TokenSet.orSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。