void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement psiElement = descriptor.getPsiElement(); final PsiFile containingFile = psiElement.getContainingFile(); Navigatable result = null; if (containingFile instanceof XmlFile xmlFile) { final XmlTag rootTag = xmlFile.getRootTag(); if (rootTag != null) { final XmlTag propTag = rootTag.createChildTag(TAG_NAME, rootTag.getNamespace(), "", false); propTag.setAttribute(NAME_ATTR, myCanonicalText); final DomElement contextElement = DomUtil.getDomElement(descriptor.getPsiElement()); PsiElement generated; if (contextElement == null) { generated = rootTag.addSubTag(propTag, true); } else { final AntDomTarget containingTarget = contextElement.getParentOfType(AntDomTarget.class, false); final DomElement anchor = containingTarget != null ? containingTarget : contextElement; final XmlTag tag = anchor.getXmlTag(); if (!rootTag.equals(tag)) { generated = tag.getParent().addBefore(propTag, tag); } else { generated = rootTag.addSubTag(propTag, true); } } if (generated instanceof XmlTag) { result = PsiNavigationSupport.getInstance().createNavigatable(project, containingFile.getVirtualFile(), ((XmlTag)generated).getValue().getTextRange() .getEndOffset()); } if (result == null && generated instanceof Navigatable) { result = (Navigatable)generated; } } } if (result != null) { result.navigate(true); } }