public void init(PsiElement element) { myFile = (XmlFile) element.getContainingFile(); if (element instanceof XmlTag) { myTag = (XmlTag) element; } else { final XmlDocument document = myFile.getDocument(); if (document != null) { myTag = document.getRootTag(); } } if (myTag != null) { myTargetNamespace = myTag.getAttributeValue("targetNamespace"); } final THashSet<PsiFile> dependenciesSet = new THashSet<PsiFile>(); final Set<PsiFile> redefineProcessingSet = myRedefinedDescriptorsInProcessing.get(); if (redefineProcessingSet != null) { dependenciesSet.addAll(redefineProcessingSet); } collectDependencies(myTag, myFile, dependenciesSet); dependencies = ArrayUtil.toObjectArray(dependenciesSet); }
private static void addDependency(final XmlFile file, final Set<PsiFile> visited) { if (file != null) { final XmlDocument document = file.getDocument(); collectDependencies(document != null ? document.getRootTag() : null, file, visited); } }