use of com.intellij.structuralsearch.impl.matcher.iterators.DocValuesIterator in project intellij-community by JetBrains.
the class JavaCompilingVisitor method visitDocTag.
@Override
public void visitDocTag(PsiDocTag psiDocTag) {
super.visitDocTag(psiDocTag);
NodeIterator sons = new DocValuesIterator(psiDocTag.getFirstChild());
while (sons.hasNext()) {
myCompilingVisitor.setHandler(sons.current(), new DocDataHandler());
sons.advance();
}
}
use of com.intellij.structuralsearch.impl.matcher.iterators.DocValuesIterator in project intellij-community by JetBrains.
the class JavaMatchingVisitor method visitDocTag.
@Override
public void visitDocTag(final PsiDocTag tag) {
final PsiDocTag tag2 = (PsiDocTag) myMatchingVisitor.getElement();
final boolean isTypedVar = myMatchingVisitor.getMatchContext().getPattern().isTypedVar(tag.getNameElement());
myMatchingVisitor.setResult(isTypedVar || tag.getName().equals(tag2.getName()));
PsiElement psiDocTagValue = tag.getValueElement();
boolean isTypedValue = false;
if (myMatchingVisitor.getResult() && psiDocTagValue != null) {
final PsiElement[] children = psiDocTagValue.getChildren();
if (children.length == 1) {
psiDocTagValue = children[0];
}
isTypedValue = myMatchingVisitor.getMatchContext().getPattern().isTypedVar(psiDocTagValue);
if (isTypedValue) {
if (tag2.getValueElement() != null) {
myMatchingVisitor.setResult(myMatchingVisitor.handleTypedElement(psiDocTagValue, tag2.getValueElement()));
} else {
myMatchingVisitor.setResult(myMatchingVisitor.allowsAbsenceOfMatch(psiDocTagValue));
}
}
}
if (myMatchingVisitor.getResult() && !isTypedValue) {
myMatchingVisitor.setResult(myMatchingVisitor.matchInAnyOrder(new DocValuesIterator(tag.getFirstChild()), new DocValuesIterator(tag2.getFirstChild())));
}
if (myMatchingVisitor.getResult() && isTypedVar) {
myMatchingVisitor.setResult(myMatchingVisitor.handleTypedElement(tag.getNameElement(), tag2.getNameElement()));
}
}
Aggregations