IdeaPlugin (PsiElement element) { final VirtualFile[] includingFiles = FileIncludeManager.getManager(element.getProject()).getIncludingFiles(element.getContainingFile().getVirtualFile(), false); if (includingFiles.length != 1) return null; final PsiFile psiFile = element.getManager().findFile(includingFiles[0]); if (!(psiFile instanceof XmlFile)) return null; return DescriptorUtil.getIdeaPlugin(((XmlFile)psiFile)); }