boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!(file instanceof XmlFile)) return false; PsiElement element = file.findElementAt(editor.getCaretModel().getOffset()); XmlAttributeValue value = PsiTreeUtil.getParentOfType(element, XmlAttributeValue.class); if (value == null) return false; XmlAttribute attribute = PsiTreeUtil.getParentOfType(value, XmlAttribute.class); if (attribute != null && attribute.isNamespaceDeclaration()) { setText(XmlBundle.message(getQuickFixKeyId())); return true; } return false; }