From 44f0a183ed3be30ae4961e5c2eeb6e25d2aeb3e8 Mon Sep 17 00:00:00 2001 From: Rob Becker Date: Sun, 8 Sep 2024 20:23:15 -0600 Subject: [PATCH] update analyzer uses to work with 5.13 and 6 --- lib/src/builder/codegen/typed_map_impl_generator.dart | 2 +- lib/src/builder/parsing/ast_util.dart | 2 +- lib/src/builder/parsing/declarations.dart | 4 ++-- pubspec.yaml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/src/builder/codegen/typed_map_impl_generator.dart b/lib/src/builder/codegen/typed_map_impl_generator.dart index 89c796f4b..2f140fc91 100644 --- a/lib/src/builder/codegen/typed_map_impl_generator.dart +++ b/lib/src/builder/codegen/typed_map_impl_generator.dart @@ -556,7 +556,7 @@ class _TypedMapImplGenerator extends TypedMapImplGenerator { for (var i = 0; i < mixins.length; i++) { final mixin = mixins[i]; final typeArguments = mixin.typeArguments?.toSource() ?? ''; - final names = TypedMapNames(mixin.name.name); + final names = TypedMapNames(mixin.name2.name); header.write('${names.consumerName}$typeArguments'); header.write(','); // Add a space at the beginning of the line so that dartfmt indents it diff --git a/lib/src/builder/parsing/ast_util.dart b/lib/src/builder/parsing/ast_util.dart index d34409d49..e7100abd7 100644 --- a/lib/src/builder/parsing/ast_util.dart +++ b/lib/src/builder/parsing/ast_util.dart @@ -69,7 +69,7 @@ extension TypeAnnotationNameHelper on TypeAnnotation { /// field of [Identifier]s. extension TypeNameHelper on NamedType { /// The type name without any namespace prefixes. - String get nameWithoutPrefix => name.nameWithoutPrefix; + String get nameWithoutPrefix => importPrefix != null ? name2.name.replaceFirst(importPrefix.toString(), '') : name2.name; } /// Utilities related to simplifying access to node identifier fields. diff --git a/lib/src/builder/parsing/declarations.dart b/lib/src/builder/parsing/declarations.dart index 1bdb384ae..12e2cafb9 100644 --- a/lib/src/builder/parsing/declarations.dart +++ b/lib/src/builder/parsing/declarations.dart @@ -204,7 +204,7 @@ mixin _TypedMapMixinShorthandDeclaration { .toList(); if (badConstraints != null && badConstraints.isNotEmpty) { - final badConstraintsString = badConstraints.map((c) => c.name.name).join(', '); + final badConstraintsString = badConstraints.map((c) => c.name2.name).join(', '); final suggestedImplName = mixin.name.name.endsWith('Mixin') ? mixin.name.name.replaceFirst(RegExp(r'Mixin$'), '') @@ -229,7 +229,7 @@ extension on Union { /// This is the safest way to retrieve that information because it takes /// into account the nature of the [Union] typing of `props`. List get allPropsMixins => this.switchCase( - (a) => a.nodeHelper.mixins.map((name) => name.name.name).toList(), + (a) => a.nodeHelper.mixins.map((name) => name.name2.name).toList(), (b) => [b.name.name], ); } diff --git a/pubspec.yaml b/pubspec.yaml index d2c0fdc68..382c0028d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ environment: dependencies: collection: ^1.15.0 - analyzer: ^5.13.0 + analyzer: '>=5.13.0 <7.0.0' build: ^2.0.0 dart_style: ^2.0.0 js: ^0.6.1+1 @@ -30,7 +30,7 @@ dev_dependencies: build_resolvers: ^2.0.0 build_runner: ^2.0.0 build_test: ^2.0.0 - build_web_compilers: ^3.0.0 + build_web_compilers: '>=3.0.0 <5.0.0' built_value_generator: ^8.0.0 dart_dev: ^4.0.1 dependency_validator: ^3.0.0