boolean (final @NotNull DataContext dataContext) { final PsiElement element = getElement(dataContext); if (element == null || PsiElementRenameHandler.isVetoed(element)) return false; PsiElement parent = element.getParent(); if (!(parent instanceof XmlTag tag)) { return false; } String prefix = tag.getNamespacePrefix(); if (StringUtil.isNotEmpty(prefix)) { Editor editor = getEditor(dataContext); assert editor != null; int offset = editor.getCaretModel().getOffset(); if (offset <= element.getTextRange().getStartOffset() + prefix.length()) { return false; } } return isDeclarationOutOfProjectOrAbsent(element.getProject(), dataContext); }