diff --git a/CHANGELOG.md b/CHANGELOG.md index 322936d6..e7aa4d83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.1.4+1 +* Patch `part of 'path'` renames. + # 2.1.4 * The `migration` argument to `model` just emits an annotation now. * Add the ORM boilerplate. diff --git a/lib/src/commands/rename.dart b/lib/src/commands/rename.dart index 553f3595..e95586f6 100644 --- a/lib/src/commands/rename.dart +++ b/lib/src/commands/rename.dart @@ -167,11 +167,13 @@ class RenamingVisitor extends RecursiveAstVisitor { @override visitPartOfDirective(PartOfDirective ctx) { - var name = ctx.libraryName.name; + if (ctx.libraryName != null) { + var name = ctx.libraryName.name; - if (name.startsWith(oldName)) { - replace[[ctx.offset, ctx.end]] = - 'part of ' + name.replaceFirst(oldName, newName) + ';'; + if (name.startsWith(oldName)) { + replace[[ctx.offset, ctx.end]] = + 'part of ' + name.replaceFirst(oldName, newName) + ';'; + } } } } diff --git a/pubspec.yaml b/pubspec.yaml index cd125d7d..e79ae8ec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ author: Tobe O description: Command-line tools for the Angel framework. homepage: https://github.com/angel-dart/angel_cli name: angel_cli -version: 2.1.4 +version: 2.1.4+1 dependencies: analyzer: ">=0.32.0" args: ^1.0.0