XmlFile (@Nullable final XmlFile file) { if (file == null) { return null; } final VirtualFile context = myAntFileToContextFileMap.get(file.getVirtualFile()); if (context == null) { return null; } final PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(context); if (!(psiFile instanceof XmlFile xmlFile)) { return null; } return AntDomFileDescription.isAntFile(xmlFile)? xmlFile : null; }