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


Java TokenSet.create方法代码示例

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


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

示例1: doApply

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@Override
public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyConditionalStatementPart statementPart)
  throws IncorrectOperationException {
  final PyExpression condition = statementPart.getCondition();
  final Document document = editor.getDocument();
  final PsiElement colon = PyPsiUtils.getFirstChildOfType(statementPart, PyTokenTypes.COLON);
  if (colon == null) {
    if (condition != null) {
      final PsiElement firstNonComment = PyPsiUtils.getNextNonCommentSibling(condition.getNextSibling(), false);
      if (firstNonComment != null && !":".equals(firstNonComment.getNode().getText())) {
        document.insertString(firstNonComment.getTextRange().getEndOffset(), ":");
      }
    }
    else {
      final TokenSet keywords = TokenSet.create(PyTokenTypes.IF_KEYWORD, PyTokenTypes.ELIF_KEYWORD, PyTokenTypes.WHILE_KEYWORD);
      final PsiElement keywordToken = PyPsiUtils.getChildByFilter(statementPart,
                                                                  keywords, 0);
      final int offset = sure(keywordToken).getTextRange().getEndOffset();
      document.insertString(offset, " :");
      processor.registerUnresolvedError(offset + 1);
    }
  }
  else if (condition == null) {
    processor.registerUnresolvedError(colon.getTextRange().getStartOffset());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:PyConditionalStatementPartFixer.java

示例2: TemplateLanguageErrorFilter

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
protected TemplateLanguageErrorFilter(
  @NotNull final TokenSet templateExpressionStartTokens,
  @NotNull final Class templateFileViewProviderClass,
  @NotNull final String... knownSubLanguageNames)
{
  myTemplateExpressionStartTokens = TokenSet.create(templateExpressionStartTokens.getTypes());
  myTemplateFileViewProviderClass = templateFileViewProviderClass;

  List<String> knownSubLanguageList = new ArrayList<String>(Arrays.asList(knownSubLanguageNames));
  knownSubLanguageList.add("JavaScript");
  knownSubLanguageList.add("CSS");
  knownLanguageSet = new HashSet<Language>();
  for (String name : knownSubLanguageList) {
    final Language language = Language.findLanguageByID(name);
    if (language != null) {
      knownLanguageSet.add(language);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TemplateLanguageErrorFilter.java

示例3: getWordsScanner

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(
            new TSLexerAdapter(),
            TokenSet.create(TSTypes.ID),
            TokenSet.create(TSTypes.COMMENT),
            TokenSet.EMPTY
    );
}
 
开发者ID:CouleeApps,项目名称:TS-IJ,代码行数:11,代码来源:TSFindUsagesProvider.java

示例4: getWordsScanner

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@Nullable
@Override
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(new AppleScriptLexerAdapter(),
          TokenSet.create(AppleScriptTypes.IDENTIFIER),
          TokenSet.create(AppleScriptTypes.COMMENT),
          TokenSet.create(AppleScriptTypes.STRING_LITERAL));
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:9,代码来源:AppleScriptFindUsagesProvider.java

示例5: getWordsScanner

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@Nullable
@Override
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(
      new SoyLexer(),
      TokenSet.create(SoyTypes.IDENTIFIER_WORD),
      TokenSet.create(SoyTypes.COMMENT_BLOCK),
      TokenSet.EMPTY);
}
 
开发者ID:google,项目名称:bamboo-soy,代码行数:10,代码来源:SoyFindUsagesProvider.java

示例6: getWordsScanner

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(new YAMLFlexLexer(),
            TokenSet.create(YAMLTokenTypes.SCALAR_KEY),
            TokenSet.create(YAMLTokenTypes.COMMENT),
            TokenSet.create(YAMLTokenTypes.SCALAR_TEXT, YAMLTokenTypes.SCALAR_DSTRING, YAMLTokenTypes.SCALAR_STRING));
}
 
开发者ID:seedstack,项目名称:intellij-plugin,代码行数:9,代码来源:CoffigFindUsagesProvider.java

示例7: getWordsScanner

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(new CrystalLexerAdapter(),
            TokenSet.create(CrystalTypes.KEY),
            TokenSet.create(CrystalTypes.COMMENT),
            TokenSet.EMPTY);
}
 
开发者ID:benoist,项目名称:intellij-crystal,代码行数:9,代码来源:CrystalFindUsagesProvider.java

示例8: getKeywordTokens

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
@NotNull
@Override
public TokenSet getKeywordTokens() {
  return TokenSet.create(
    AND_KEYWORD, AS_KEYWORD, ASSERT_KEYWORD, BREAK_KEYWORD, CLASS_KEYWORD,
    CONTINUE_KEYWORD, DEF_KEYWORD, DEL_KEYWORD, ELIF_KEYWORD, ELSE_KEYWORD,
    EXCEPT_KEYWORD, EXEC_KEYWORD, FINALLY_KEYWORD, FOR_KEYWORD,
    FROM_KEYWORD,
    GLOBAL_KEYWORD, IF_KEYWORD, IMPORT_KEYWORD, IN_KEYWORD, IS_KEYWORD,
    LAMBDA_KEYWORD, NOT_KEYWORD, OR_KEYWORD, PASS_KEYWORD, PRINT_KEYWORD,
    RAISE_KEYWORD, RETURN_KEYWORD, TRY_KEYWORD, WITH_KEYWORD, WHILE_KEYWORD,
    YIELD_KEYWORD,
    NONE_KEYWORD, TRUE_KEYWORD, FALSE_KEYWORD, NONLOCAL_KEYWORD, DEBUG_KEYWORD, ASYNC_KEYWORD, AWAIT_KEYWORD);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PythonTokenSetContributor.java

示例9: PsiAwareLineWrapPositionStrategy

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
/**
 * Creates new <code>PsiAwareLineWrapPositionStrategy</code> object.
 * 
 * @param nonVirtualOnly  defines if current PSI-aware logic should be exploited only for 'real wrap' position requests
 * @param enabledTypes    target element/token types where line wrapping is allowed
 */
public PsiAwareLineWrapPositionStrategy(boolean nonVirtualOnly, @NotNull IElementType ... enabledTypes) {
  myEnabledTypes = TokenSet.create(enabledTypes);
  myNonVirtualOnly = nonVirtualOnly;
  if (enabledTypes.length <= 0) {
    LOG.warn(String.format("%s instance is created with empty token/element types. That will lead to inability to perform line wrap",
                           getClass().getName()));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PsiAwareLineWrapPositionStrategy.java

示例10: getFunctionDeclarationTokens

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

示例11: PyWordsScanner

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
public PyWordsScanner() {
    super(new PythonLexer(),
            TokenSet.create(PyTokenTypes.IDENTIFIER),
            TokenSet.create(PyTokenTypes.END_OF_LINE_COMMENT),
            PyTokenTypes.STRING_NODES);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:PyWordsScanner.java

示例12: TemplateHighlighter

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
public TemplateHighlighter() {
  myLexer = new MergingLexerAdapter(new FlexAdapter(new FileTemplateTextLexer()), TokenSet.create(FileTemplateTokenType.TEXT));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FileTemplateConfigurable.java

示例13: withinPairInside

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
public RuleBuilder withinPairInside(IElementType pairFirst, IElementType pairSecond, IElementType parent) {
  TokenSet parentSet = TokenSet.create(parent);
  RuleCondition before = new RuleCondition(parentSet, TokenSet.create(pairFirst), null);
  RuleCondition after = new RuleCondition(parentSet, null, TokenSet.create(pairSecond));
  return new RuleBuilder(before, after);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:SpacingBuilder.java

示例14: BinaryExpression

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
public BinaryExpression(IElementType compositeType, IElementType... opTokens) {
  myCompositeType = compositeType;
  myOpTokens = TokenSet.create(opTokens);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:BinaryExpression.java

示例15: betweenInside

import com.intellij.psi.tree.TokenSet; //导入方法依赖的package包/类
public RuleBuilder betweenInside(IElementType leftType, IElementType rightType, IElementType parentType) {
  return new RuleBuilder(new RuleCondition(TokenSet.create(parentType), TokenSet.create(leftType), TokenSet.create(rightType)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:SpacingBuilder.java


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