compute method
Computes the changes for this producer using builder.
This method should not modify fixKind.
Implementation
@override
Future<void> compute(ChangeBuilder builder) async {
final classDecl = node.thisOrAncestorOfType<ClassDeclaration>();
if (classDecl == null) return;
if (getCopyWithMethod(classDecl) != null) return;
await builder.addDartFileEdit(file, (builder) {
final insertOffset = classDecl.rightBracket.offset;
builder.addInsertion(insertOffset, (builder) {
final snippet = buildCopyWithSnippet(classDecl);
if (snippet != null) builder.write(snippet);
});
builder.format(SourceRange(0, unitResult.content.length));
});
}