本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: getWhitespaceTokens
import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@NotNull
@Override
public TokenSet getWhitespaceTokens() {
return TokenSet.orSet(super.getWhitespaceTokens(), TokenSet.create(PyDocstringTokenTypes.DOTS));
}
示例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));
}