use of org.intellij.lang.xpath.xslt.util.NamedTemplateMatcher in project intellij-community by JetBrains.
the class TemplateReference method multiResolve.
@NotNull
public ResolveResult[] multiResolve(boolean incompleteCode) {
final PsiElement element = resolve();
if (element != null) {
return new ResolveResult[] { new PsiElementResolveResult(element) };
}
final XmlFile xmlFile = (XmlFile) getElement().getContainingFile();
if (xmlFile != null) {
final List<PsiElementResolveResult> targets = new SmartList<>();
XsltIncludeIndex.processBackwardDependencies(xmlFile, xmlFile1 -> {
final PsiElement e = ResolveUtil.resolve(new NamedTemplateMatcher(xmlFile1.getDocument(), myName));
if (e != null) {
targets.add(new PsiElementResolveResult(e));
}
return true;
});
return targets.toArray(new ResolveResult[targets.size()]);
} else {
return ResolveResult.EMPTY_ARRAY;
}
}
Aggregations