@Override
  public XmlAttribute handleContentChange(@NotNull XmlAttribute attribute, @NotNull TextRange range, String newContent) throws IncorrectOperationException {
    String attr = attribute.getText();
    ASTNode astNode = XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(attribute.getNode());
    assert astNode != null;
    PsiElement namePsi = astNode.getPsi();
    int startOffsetInParent = namePsi.getStartOffsetInParent();
    TextRange nameRange = new TextRange(startOffsetInParent, startOffsetInParent + namePsi.getTextLength());

    if (nameRange.contains(range)) {
      String content = attr.substring(0, range.getStartOffset()) + newContent + attr.substring(range.getEndOffset(), nameRange.getEndOffset());

      attribute.setName(content);
    } else {
      final XmlAttributeValue value = attribute.getValueElement();

      if (value == null) {
        assert range.getStartOffset() == 0 && range.getEndOffset() == 0;
        attribute.setValue(newContent);
        return attribute;
      }
      final StringBuilder replacement = new StringBuilder(value.getText());
      int offset = value.getTextRange().getStartOffset() - attribute.getTextRange().getStartOffset();

      replacement.replace(
        range.getStartOffset() - offset,
        range.getEndOffset() - offset,
        newContent
      );
      attribute.setValue(replacement.toString());
    }
    return attribute;
  }
@Override
  public XmlAttribute handleContentChange(@NotNull XmlAttribute attribute, @NotNull TextRange range, String newContent)