Skip to content

Commit c2c38fa

Browse files
Use nameLexeme from over_react
1 parent 0a03173 commit c2c38fa

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

tools/analyzer_plugin/lib/src/diagnostic/exhaustive_deps.dart

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import 'package:analyzer_plugin/protocol/protocol_common.dart' show Location;
3434
import 'package:over_react_analyzer_plugin/src/diagnostic/analyzer_debug_helper.dart';
3535
import 'package:over_react_analyzer_plugin/src/diagnostic_contributor.dart';
3636
import 'package:over_react_analyzer_plugin/src/indent_util.dart';
37+
import 'package:over_react_analyzer_plugin/src/over_react_builder_parsing.dart' show TypeNameHelper;
3738
import 'package:over_react_analyzer_plugin/src/util/ast_util.dart';
3839
import 'package:over_react_analyzer_plugin/src/util/function_components.dart';
3940
import 'package:over_react_analyzer_plugin/src/util/pretty_print.dart';
@@ -2365,20 +2366,3 @@ extension<E extends Comparable<dynamic>> on Iterable<E> {
23652366
return true;
23662367
}
23672368
}
2368-
2369-
extension TypeNameHelper on NamedType {
2370-
// Backwards compatibility for various analyzer versions that remove name/name2.
2371-
// ignore: unnecessary_this
2372-
dynamic get name => this.name2; // Use `this.` to point to real impl if it exists, not extension.
2373-
// ignore: unnecessary_this
2374-
dynamic get name2 => this.name; // Use `this.` to point to real impl if it exists, not extension.
2375-
dynamic get _name => name;
2376-
2377-
String get nameLexeme {
2378-
final dynamic name = _name;
2379-
if (name is Identifier) return name.name;
2380-
if (name is Token) return name.lexeme;
2381-
if (name is String) return name;
2382-
throw UnimplementedError('Unexpected type for name: ${name.runtimeType}');
2383-
}
2384-
}

0 commit comments

Comments
 (0)