void (Project project, XmlAttribute attribute, XmlTag parent) { if (!attribute.isNamespaceDeclaration()) { SchemaPrefix schemaPrefix = DefaultXmlExtension.DEFAULT_EXTENSION.getPrefixDeclaration(parent, myPrefix); if (schemaPrefix != null) { attribute = schemaPrefix.getDeclaration(); } else { // declaration was already removed by previous fix in "Fix all" return; } } String namespace = attribute.getValue(); String prefix = getDeclaredPrefix(attribute); PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project); Document document = parent.getContainingFile().getViewProvider().getDocument(); assert document != null; attribute.delete(); if (myRemoveLocation) { if (prefix.isEmpty()) { XmlAttribute locationAttr = getDefaultLocation(parent); if (locationAttr != null) { locationAttr.delete(); } } else { documentManager.doPostponedOperationsAndUnblockDocument(document); PsiReference[] references = getLocationReferences(namespace, parent); removeReferencesOrAttribute(references); documentManager.commitDocument(document); } } }