5
5
import 'package:analyzer/dart/analysis/analysis_context.dart' ;
6
6
import 'package:analyzer/dart/analysis/results.dart' ;
7
7
import 'package:analyzer/dart/analysis/session.dart' ;
8
- import 'package:analyzer/dart/element/element.dart' ;
9
- import 'package:analyzer/dart/element/visitor.dart' ;
10
8
import 'package:analyzer/file_system/file_system.dart' ;
11
9
import 'package:analyzer/src/dart/analysis/analysis_context_collection.dart' ;
12
10
import 'package:analyzer/src/dart/analysis/byte_store.dart' ;
@@ -23,24 +21,6 @@ import 'package:meta/meta.dart';
23
21
24
22
import 'src/utilities/mock_packages.dart' ;
25
23
26
- /// Finds an [Element] with the given [name] .
27
- Element ? findChildElement (Element root, String name, [ElementKind ? kind]) {
28
- Element ? result;
29
- root.accept (_ElementVisitorFunctionWrapper ((Element element) {
30
- if (element.name != name) {
31
- return ;
32
- }
33
- if (kind != null && element.kind != kind) {
34
- return ;
35
- }
36
- result = element;
37
- }));
38
- return result;
39
- }
40
-
41
- /// A function to be called for every [Element] .
42
- typedef _ElementVisitorFunction = void Function (Element element);
43
-
44
24
class AbstractContextTest with ResourceProviderMixin {
45
25
static bool _lintRulesAreRegistered = false ;
46
26
@@ -313,16 +293,3 @@ class AbstractContextTest with ResourceProviderMixin {
313
293
verifyCreatedCollection ();
314
294
}
315
295
}
316
-
317
- /// Wraps the given [_ElementVisitorFunction] into an instance of
318
- /// [engine.GeneralizingElementVisitor] .
319
- class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor <void > {
320
- final _ElementVisitorFunction function;
321
- _ElementVisitorFunctionWrapper (this .function);
322
-
323
- @override
324
- void visitElement (Element element) {
325
- function (element);
326
- super .visitElement (element);
327
- }
328
- }
0 commit comments