ON_invocationFindByMethodName method
Implementation
@override
MethodManagerResultData ON_invocationFindByMethodName({
String? replacementHandlerBody,
}) {
final visitor = ON_invocationFindByMethodNameVisitor(methodName!);
parsedFileUnit.visitChildren(visitor);
if (visitor.result == null) {
return dataSingleton;
}
if (replacementHandlerBody == null) {
dataSingleton.addTaskResultValue(visitor.result);
return dataSingleton;
}
String? fullNewSourceCode;
fullNewSourceCode = parsedFileContent.replaceRange(
visitor.result!.handlerBody.offset,
visitor.result!.handlerBody.end,
replacementHandlerBody.trim(),
);
dataSingleton.addTaskResultValue(visitor.result, {
"fullNewSourceCode": fullNewSourceCode,
});
return dataSingleton;
}