use of com.intellij.psi.PsiRecursiveElementWalkingVisitor in project intellij-community by JetBrains.
the class PlatformTestUtil method collectWebReferences.
@NotNull
public static List<WebReference> collectWebReferences(@NotNull PsiElement element) {
List<WebReference> refs = new ArrayList<>();
element.accept(new PsiRecursiveElementWalkingVisitor() {
@Override
public void visitElement(PsiElement element) {
for (PsiReference ref : element.getReferences()) {
if (ref instanceof WebReference) {
refs.add((WebReference) ref);
}
}
super.visitElement(element);
}
});
return refs;
}
Aggregations