• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Tokenizer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.spellchecker.tokenizer.Tokenizer的典型用法代码示例。如果您正苦于以下问题:Java Tokenizer类的具体用法?Java Tokenizer怎么用?Java Tokenizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Tokenizer类属于com.intellij.spellchecker.tokenizer包,在下文中一共展示了Tokenizer类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  if (element instanceof PsiMethod) {
    return myMethodNameTokenizer;
  }
  if (element instanceof PsiDocComment) {
    return myDocCommentTokenizer;
  }
  if (element instanceof PsiLiteralExpression) {
    if (SuppressManager.isSuppressedInspectionName((PsiLiteralExpression)element)) {
      return EMPTY_TOKENIZER;
    }
    return myLiteralExpressionTokenizer;
  }
  if (element instanceof PsiNamedElement) {
    return myNamedElementTokenizer;
  }

  return super.getTokenizer(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:JavaSpellcheckingStrategy.java


示例2: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  // Only allow print and println strings to be tokenized. We don't want to flag
  // strings in Gradle files that are not under the user's control: names of
  // dependencies, names of plugins, names of class path elements, etc. Turns
  // out there are a lot of different forms of these, so rather than trying to
  // blacklist all the types of strings we don't want to spell check, instead we
  // simply whitelist "print" and "println":
  if (TokenSets.STRING_LITERAL_SET.contains(element.getNode().getElementType()) &&
      !isPrint(element)) {
    // If this element references some external name, such as a dependency or an
    // application package, there is no point in flagging it since the user can't
    // change it
    return EMPTY_TOKENIZER;
  }

  return super.getTokenizer(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AndroidGradleSpellcheckingStrategy.java


示例3: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  if (TokenSets.STRING_LITERAL_SET.contains(element.getNode().getElementType())) {
    return myStringTokenizer;
  }
  if (element instanceof GrNamedElement) {
    final PsiElement name = ((GrNamedElement)element).getNameIdentifierGroovy();
    if (TokenSets.STRING_LITERAL_SET.contains(name.getNode().getElementType())) {
      return EMPTY_TOKENIZER;
    }
  }
  if (element instanceof PsiDocComment) return myDocCommentTokenizer;
  //if (element instanceof GrLiteralImpl && ((GrLiteralImpl)element).isStringLiteral()) return myStringTokenizer;
  return super.getTokenizer(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:GroovySpellcheckingStrategy.java


示例4: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
    if (element instanceof PsiWhiteSpace) {
        return EMPTY_TOKENIZER;
    }
    if (element instanceof PsiNameIdentifierOwner) {
        return new PsiIdentifierOwnerTokenizer();
    }
    if (element.getParent() instanceof PsiNameIdentifierOwner) {
        return EMPTY_TOKENIZER;
    }
    if (element.getNode().getElementType() == JSGraphQLEndpointTokenTypes.IDENTIFIER) {
        return IDENTIFIER_TOKENIZER;
    }
    if (element instanceof PsiComment) {
        if (SuppressionUtil.isSuppressionComment(element)) {
            return EMPTY_TOKENIZER;
        }
        return myCommentTokenizer;
    }
    return EMPTY_TOKENIZER;
}
 
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:24,代码来源:JSGraphQLEndpointSpellcheckingStrategy.java


示例5: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {

    if(!(element instanceof StringLiteralExpression)) {
        return super.getTokenizer(element);
    }

    if(!ProjectComponent.isEnabled(element.getProject())) {
        return super.getTokenizer(element);
    }

    Container container = Utils.findContainerForPimpleArrayAccessLiteral((StringLiteralExpression) element);
    if (container == null) {

        container = Utils.findContainerForFirstParameterOfPimpleMethod((StringLiteralExpression) element);
        if (container == null) {
            return super.getTokenizer(element);
        }
    }

    return DUMMY_TOKENIZER;
}
 
开发者ID:Sorien,项目名称:silex-idea-plugin,代码行数:24,代码来源:SpellcheckingStrategy.java


示例6: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  if (element instanceof JsonStringLiteral) {
    return ourStringLiteralTokenizer;
  }
  return super.getTokenizer(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JsonSpellcheckerStrategy.java


示例7: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  IElementType elementType = element.getNode().getElementType();
  if (elementType == RestTokenTypes.FIELD ||
      elementType == RestTokenTypes.CUSTOM_DIRECTIVE ||
      elementType == RestTokenTypes.REST_DJANGO_INJECTION ||
      elementType == RestTokenTypes.REST_INJECTION) {
    return EMPTY_TOKENIZER;
  }
  if (element instanceof LeafPsiElement && element.getLanguage() == RestLanguage.INSTANCE) {
    return REST_ELEMENT_TOKENIZER;
  }
  return EMPTY_TOKENIZER;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:RestSpellcheckerStrategy.java


示例8: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  if (element instanceof PyStringLiteralExpression) {
    PsiElement parent = element.getParent();
    if (parent instanceof PyBinaryExpression) {
      PyBinaryExpression binaryExpression = (PyBinaryExpression)parent;
      if (element == binaryExpression.getLeftExpression() && binaryExpression.getOperator() == PyTokenTypes.PERC) {
        return myFormatStringTokenizer;
      }
    }
    return myStringLiteralTokenizer;
  }
  return super.getTokenizer(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PythonSpellcheckerStrategy.java


示例9: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  if (isAttributeValueContext(element)) {
    return getAttributeValueTokenizer(element);
  }

  if (inEnglish(element)) {
    return super.getTokenizer(element);
  }

  return EMPTY_TOKENIZER;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AndroidXmlSpellcheckingStrategy.java


示例10: getAttributeValueTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
public Tokenizer getAttributeValueTokenizer(PsiElement element) {
  assert element instanceof XmlAttributeValue;

  if (AndroidResourceUtil.isIdDeclaration((XmlAttributeValue)element)) {
    return myAttributeValueRenamingTokenizer;
  }
  final PsiElement parent = element.getParent();

  if (parent instanceof XmlAttribute) {
    final String value = ((XmlAttribute)parent).getValue();

    if (value != null) {
      final GenericAttributeValue domValue = DomManager.getDomManager(
        parent.getProject()).getDomElement((XmlAttribute)parent);

      if (domValue != null) {
        final Converter converter = domValue.getConverter();

        if (converter instanceof ResourceReferenceConverter) {
          return myResourceReferenceTokenizer;
        }
        else if (converter instanceof ConstantFieldConverter) {
          return EMPTY_TOKENIZER;
        }
        else if (converter instanceof ResourceNameConverter || converter instanceof AndroidPackageConverter) {
          return myAttributeValueRenamingTokenizer;
        }
      }
    }
  }
  return super.getTokenizer(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:AndroidXmlSpellcheckingStrategy.java


示例11: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  if (element instanceof PropertyValueImpl) {
    return myPropertyValueTokenizer;
  }
  if (element instanceof PropertyKeyImpl) {
    return myPropertyTokenizer;
  }
  return super.getTokenizer(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PropertiesSpellcheckingStrategy.java


示例12: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
    IElementType elementType = element.getNode().getElementType();

    if (elementType instanceof MultiMarkdownTokenType || elementType instanceof MultiMarkdownElementType) {
        if (NO_SPELL_CHECK_SET.contains(elementType)) {
            //logger.info("empty tokenizer for " + element.toString());
            return EMPTY_TOKENIZER;
        }

        // here we can return custom tokenizers if needed
        //logger.info("text tokenizer for " + element.toString());
        if (element instanceof MultiMarkdownNamedElement) {
            //logger.info("identifier tokenizer for " + element.toString());
            return IDENTIFIER_TOKENIZER;
        }

        // this is to prevent two spelling errors for every occurence but these are rename and change to so we'll keep them
        //if (NO_SPELL_LEAF_SET.contains(elementType)) {
        //    return EMPTY_TOKENIZER;
        //}

        return TEXT_TOKENIZER;
    }
    return super.getTokenizer(element);
}
 
开发者ID:vsch,项目名称:idea-multimarkdown,代码行数:28,代码来源:MultiMarkdownSpellcheckingStrategy.java


示例13: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
/**
 * Provides {@link #TEXT_TOKENIZER} for {@link LatexText} elements.
 *
 * @param element to check
 * @return {@link #TEXT_TOKENIZER} for {@link LatexText} or {@link #EMPTY_TOKENIZER}.
 */
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
    if (element instanceof LatexText) {
        return TEXT_TOKENIZER;
    }
    return EMPTY_TOKENIZER;
}
 
开发者ID:hsz,项目名称:idea-latex,代码行数:15,代码来源:LatexSpellcheckingStrategy.java


示例14: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  if (element instanceof PropertyValueImpl) {
    return myPropertyValueTokenizer;
  }
  if (element instanceof PropertyImpl) {
    return myPropertyTokenizer;
  }
  return super.getTokenizer(element);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:PropertiesSpellcheckingStrategy.java


示例15: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element)
{
	if(element instanceof PsiNameIdentifierOwner)
	{
		return ourNameTokenizer;
	}
	return super.getTokenizer(element);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:11,代码来源:CSharpSpellcheckingStrategy.java


示例16: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  IElementType elementType = element.getNode().getElementType();
  if (elementType == AsciiDocTokenTypes.HEADING || elementType == AsciiDocTokenTypes.TEXT) {
    return TEXT_TOKENIZER;
  }
  return EMPTY_TOKENIZER;
}
 
开发者ID:asciidoctor,项目名称:asciidoctor-intellij-plugin,代码行数:10,代码来源:AsciiDocSpellcheckingStrategy.java


示例17: getTokenizer

import com.intellij.spellchecker.tokenizer.Tokenizer; //导入依赖的package包/类
@NotNull
@Override
public Tokenizer getTokenizer(PsiElement element) {
  return EMPTY_TOKENIZER;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:AndroidTextSpellcheckingStrategy.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NodesBlock类代码示例发布时间:2022-05-22
下一篇:
Java ODataApplicationException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap