diff --git a/tools/analyzer_plugin/lib/src/assist/toggle_stateful.dart b/tools/analyzer_plugin/lib/src/assist/toggle_stateful.dart index 4adf0fbff..ab9cd952e 100644 --- a/tools/analyzer_plugin/lib/src/assist/toggle_stateful.dart +++ b/tools/analyzer_plugin/lib/src/assist/toggle_stateful.dart @@ -47,7 +47,7 @@ class ToggleComponentStatefulness extends AssistContributorBase with ComponentDe await super.computeAssists(request, collector); if (!setupCompute() || !initializeAssistApi(request.result.content)) return; - newComponentBaseClass = _getNewBase(componentSupertypeNode.name.name); + newComponentBaseClass = _getNewBase(componentSupertypeNode.nameLexeme); // If there is no known corresponding base class, short circuit. if (newComponentBaseClass == null) return; diff --git a/tools/analyzer_plugin/lib/src/diagnostic/exhaustive_deps.dart b/tools/analyzer_plugin/lib/src/diagnostic/exhaustive_deps.dart index 81c75407a..8f8f5efb2 100644 --- a/tools/analyzer_plugin/lib/src/diagnostic/exhaustive_deps.dart +++ b/tools/analyzer_plugin/lib/src/diagnostic/exhaustive_deps.dart @@ -34,6 +34,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart' show Location; import 'package:over_react_analyzer_plugin/src/diagnostic/analyzer_debug_helper.dart'; import 'package:over_react_analyzer_plugin/src/diagnostic_contributor.dart'; import 'package:over_react_analyzer_plugin/src/indent_util.dart'; +import 'package:over_react_analyzer_plugin/src/over_react_builder_parsing.dart' show TypeNameHelper; import 'package:over_react_analyzer_plugin/src/util/ast_util.dart'; import 'package:over_react_analyzer_plugin/src/util/function_components.dart'; import 'package:over_react_analyzer_plugin/src/util/pretty_print.dart'; @@ -680,7 +681,7 @@ class ExhaustiveDeps extends DiagnosticContributor { // NamedType case. This is for references to generic type parameters // (references to other types will get filtered out by the isDeclaredInPureScope check above). (reference) { - dependency = reference.name.name; + dependency = reference.nameLexeme; // These aren't possible for type annotations. isStable = false; isUsedAsCascadeTarget = false; @@ -1980,7 +1981,7 @@ _Recommendations collectRecommendations({ String? getConstructionExpressionType(Expression node) { if (node is InstanceCreationExpression) { if (node.isConst) return null; - return node.constructorName.type.name.name; + return node.constructorName.type.nameLexeme; } else if (node is ListLiteral) { return _DepType.list; } else if (node is SetOrMapLiteral) { diff --git a/tools/analyzer_plugin/lib/src/diagnostic/visitors/non_static_reference_visitor.dart b/tools/analyzer_plugin/lib/src/diagnostic/visitors/non_static_reference_visitor.dart index 46596437d..083383090 100644 --- a/tools/analyzer_plugin/lib/src/diagnostic/visitors/non_static_reference_visitor.dart +++ b/tools/analyzer_plugin/lib/src/diagnostic/visitors/non_static_reference_visitor.dart @@ -70,7 +70,7 @@ bool referencesImplicitThis(SimpleIdentifier identifier) { } // not a class member final Element? enclosingElement = element.enclosingElement; - if (enclosingElement is! InterfaceOrAugmentationElement) { + if (enclosingElement is! InterfaceElement) { return false; } // comment diff --git a/tools/analyzer_plugin/pubspec.yaml b/tools/analyzer_plugin/pubspec.yaml index 09bf75bbc..2bee645c1 100644 --- a/tools/analyzer_plugin/pubspec.yaml +++ b/tools/analyzer_plugin/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/Workiva/over_react/tree/master/tools/analyzer_plu environment: sdk: '>=2.19.0 <3.0.0' dependencies: - analyzer: ^5.11.0 + analyzer: '>=5.11.0 <7.0.0' analyzer_plugin: ^0.11.0 collection: ^1.15.0-nullsafety.4 meta: ^1.16.0 diff --git a/tools/analyzer_plugin/test/integration/stubs.dart b/tools/analyzer_plugin/test/integration/stubs.dart index 6af6f0050..b66650633 100644 --- a/tools/analyzer_plugin/test/integration/stubs.dart +++ b/tools/analyzer_plugin/test/integration/stubs.dart @@ -101,6 +101,7 @@ class StubServerPlugin implements ServerPlugin { handleEditGetRefactoring(parameters) => throw UnimplementedError(); @override + // ignore: override_on_non_overriding_member handleKytheGetKytheEntries(parameters) => throw UnimplementedError(); @override diff --git a/tools/analyzer_plugin/test/unit/util/prop_declaration/util.dart b/tools/analyzer_plugin/test/unit/util/prop_declaration/util.dart index fd19f2242..e481dd115 100644 --- a/tools/analyzer_plugin/test/unit/util/prop_declaration/util.dart +++ b/tools/analyzer_plugin/test/unit/util/prop_declaration/util.dart @@ -42,6 +42,8 @@ Future resolveFileAndGeneratedPart(SharedAnalysisContext sha .where((e) => e.severity != Severity.info && !e.errorCode.name.toLowerCase().startsWith('unused_')) // FIXME(FED-2015) remove once these are properly ignored in generated code .where((e) => e.errorCode.name.toLowerCase() != 'invalid_use_of_visible_for_overriding_member') + // For some reason this is triggering for '$mustCallSuper'; ignore for now. FIXME look into what's going on here + .where((e) => e.errorCode.name.toLowerCase() != 'invalid_annotation_target') .toList(); final libraryResult = await getResolvedUnit(libraryFullPath);