@Override public int getBraceTokenGroupId(IElementType tokenType) { final Language l = tokenType.getLanguage(); PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(l); if (matcher != null) { BracePair[] pairs = matcher.getPairs(); for (BracePair pair : pairs) { if (pair.getLeftBraceType() == tokenType || pair.getRightBraceType() == tokenType ) { return l.hashCode(); } } } if (tokenType instanceof IXmlLeafElementType) { return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER ? XML_VALUE_DELIMITER_GROUP : XML_TAG_TOKEN_GROUP; } else{ return BraceMatchingUtil.UNDEFINED_TOKEN_GROUP; } }
public int getBraceTokenGroupId(IElementType tokenType) { final Language l = tokenType.getLanguage(); PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(l); if (matcher != null) { BracePair[] pairs = matcher.getPairs(); for (BracePair pair : pairs) { if (pair.getLeftBraceType() == tokenType || pair.getRightBraceType() == tokenType ) { return l.hashCode(); } } } if (tokenType instanceof IXmlLeafElementType) { return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER ? XML_VALUE_DELIMITER_GROUP : XML_TAG_TOKEN_GROUP; } else{ return BraceMatchingUtil.UNDEFINED_TOKEN_GROUP; } }
@Override public boolean isInternalReference() { for(ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext()) { if(e.getElementType() instanceof IXmlLeafElementType) { XmlToken token = (XmlToken) SourceTreeToPsiMap.treeElementToPsi(e); if(token.getTokenType() == XmlTokenType.XML_DOCTYPE_PUBLIC || token.getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM) { return false; } } } return true; }
@Override public LeafElement createLeaf(@NotNull final IElementType type, @NotNull CharSequence text) { if (type instanceof IXmlLeafElementType) { if (type == XML_REAL_WHITE_SPACE) { return new PsiWhiteSpaceImpl(text); } return new XmlTokenImpl(type, text); } return null; }
@Override public boolean isInternalReference() { for (ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext()) { if (e.getElementType() instanceof IXmlLeafElementType) { XmlToken token = (XmlToken)SourceTreeToPsiMap.treeElementToPsi(e); if (token.getTokenType() == XmlTokenType.XML_DOCTYPE_PUBLIC || token.getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM) { return false; } } } return true; }
public LeafElement createLeaf(final IElementType type, CharSequence text) { if (type instanceof IXmlLeafElementType) { if (type == XML_REAL_WHITE_SPACE) { return new PsiWhiteSpaceImpl(text); } return new XmlTokenImpl(type, text); } return null; }
public boolean isInternalReference() { for (ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext()) { if (e.getElementType() instanceof IXmlLeafElementType) { XmlToken token = (XmlToken)SourceTreeToPsiMap.treeElementToPsi(e); if (token.getTokenType() == XmlTokenType.XML_DOCTYPE_PUBLIC || token.getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM) { return false; } } } return true; }
@NotNull @Override public LeafElement createLeaf(@NotNull IElementType type, @NotNull LanguageVersion languageVersion, @NotNull CharSequence text) { if (type instanceof IXmlLeafElementType) { if (type == XML_REAL_WHITE_SPACE) { return new PsiWhiteSpaceImpl(text); } return new XmlTokenImpl(type, text); } return null; }
@Override public boolean apply(@Nullable IElementType input) { return input instanceof IXmlLeafElementType; }