當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。