Patch.fromAstNode constructor
Patch.fromAstNode(
- AstNode astNode, {
- required String replaceTo,
Implementation
factory Patch.fromAstNode(
AstNode astNode, {
required String replaceTo,
}) {
return Patch(
replaceTo: replaceTo,
offset: astNode.offset,
// if Directive should include the `\n`
length: astNode.length + (astNode is Directive ? 1 : 0),
);
}