void (PsiElement e, List<? super TextRange> result) { XmlTag tag = PsiTreeUtil.getParentOfType(e, XmlTag.class, true); while (tag != null) { result.add(tag.getTextRange()); final ASTNode tagStartEnd = XmlChildRole.START_TAG_END_FINDER.findChild(tag.getNode()); final ASTNode tagEndStart = XmlChildRole.CLOSING_TAG_START_FINDER.findChild(tag.getNode()); if (tagStartEnd != null && tagEndStart != null) { result.add(new UnfairTextRange(tagStartEnd.getTextRange().getEndOffset(), tagEndStart.getTextRange().getStartOffset())); } if (tagStartEnd != null) { result.add(new TextRange(tag.getTextRange().getStartOffset(), tagStartEnd.getTextRange().getEndOffset())); } if (tagEndStart != null) { result.add(new TextRange(tagEndStart.getTextRange().getStartOffset(), tag.getTextRange().getEndOffset())); } tag = PsiTreeUtil.getParentOfType(tag, XmlTag.class, true); } }