// if there is a prefix, remove the prefix as well
int nodeEnd;
int len;
if (offset == 0) {
SourceRange range= getExtendedRange(node);
offset= range.getStartPosition();
len= range.getLength();
nodeEnd= offset+len;
} else {
nodeEnd= getExtendedEnd(node);
len= nodeEnd-offset;
}
doTextRemoveAndVisit(offset, len, node, editGroup);
return nodeEnd;
}
case RewriteEvent.REPLACED: {
ASTNode node= (ASTNode) event.getOriginalValue();
TextEditGroup editGroup= getEditGroup(event);
SourceRange range= getExtendedRange(node);
int nodeOffset= range.getStartPosition();
int nodeLen= range.getLength();
doTextRemoveAndVisit(nodeOffset, nodeLen, node, editGroup);
doTextInsert(nodeOffset, (ASTNode) event.getNewValue(), getIndent(offset), true, editGroup);
return nodeOffset + nodeLen;
}
}