本文整理匯總了Java中com.intellij.psi.TokenType.BAD_CHARACTER屬性的典型用法代碼示例。如果您正苦於以下問題:Java TokenType.BAD_CHARACTER屬性的具體用法?Java TokenType.BAD_CHARACTER怎麽用?Java TokenType.BAD_CHARACTER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.psi.TokenType
的用法示例。
在下文中一共展示了TokenType.BAD_CHARACTER屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildVisitor
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
return new PsiElementVisitor() {
@Override
public void visitElement(PsiElement element) {
if (element == null || !holder.getFile().getLanguage().isKindOf(CsvLanguage.INSTANCE)) {
return;
}
IElementType elementType = CsvIntentionHelper.getElementType(element);
PsiElement firstChild = element.getFirstChild();
PsiElement nextSibling = element.getNextSibling();
if (elementType == TokenType.ERROR_ELEMENT && CsvIntentionHelper.getElementType(firstChild) == TokenType.BAD_CHARACTER) {
if (firstChild.getText().equals("\"")) {
holder.registerProblem(element, UNESCAPED_SEQUENCE, fixUnescapedSequence);
} else {
holder.registerProblem(element, SEPARATOR_MISSING, fixSeparatorMissing);
holder.registerProblem(element, UNESCAPED_SEQUENCE, fixUnescapedSequence);
}
} else if ((elementType == CsvTypes.TEXT || elementType == CsvTypes.ESCAPED_TEXT)
&& CsvIntentionHelper.getElementType(nextSibling) == TokenType.ERROR_ELEMENT
&& nextSibling.getFirstChild() == null) {
holder.registerProblem(element, CLOSING_QUOTE_MISSING, fixClosingQuoteMissing);
}
}
};
}
示例2: getTokenType
@Nullable
@Override
public IElementType getTokenType() {
if (myPos >= myEndOffset) {
return null;
}
if (findNextMarkIfStoppedOnMarkAndNotAtStart() != myEndOffset) {
return TokenType.CODE_FRAGMENT;
}
return TokenType.BAD_CHARACTER;
}
示例3: advance
@Override
public void advance() {
myCurrentStart = getCurrentStart();
myCurrentEnd = getCurrentEnd();
myCurrentAttributes = myIterator.getTokenType() == TokenType.BAD_CHARACTER ? EMPTY_ATTRIBUTES : myIterator.getTextAttributes();
myIterator.advance();
}