Index: pkg/analyzer_plugin/test/support/abstract_context.dart |
diff --git a/pkg/analyzer_plugin/test/support/abstract_context.dart b/pkg/analyzer_plugin/test/support/abstract_context.dart |
index 0dd6652b24282a1ffad220f5e280f4280c0d86d8..663b8e3fdc5d576c18f992a2e164403e9838f93d 100644 |
--- a/pkg/analyzer_plugin/test/support/abstract_context.dart |
+++ b/pkg/analyzer_plugin/test/support/abstract_context.dart |
@@ -6,7 +6,6 @@ import 'dart:async'; |
import 'package:analyzer/dart/analysis/session.dart'; |
import 'package:analyzer/dart/ast/ast.dart'; |
-import 'package:analyzer/dart/ast/visitor.dart'; |
import 'package:analyzer/dart/element/element.dart'; |
import 'package:analyzer/dart/element/visitor.dart'; |
import 'package:analyzer/exception/exception.dart'; |
@@ -19,6 +18,7 @@ import 'package:analyzer/src/generated/engine.dart'; |
import 'package:analyzer/src/generated/engine.dart' as engine; |
import 'package:analyzer/src/generated/sdk.dart'; |
import 'package:analyzer/src/generated/source_io.dart'; |
+import 'package:analyzer/src/generated/testing/element_search.dart'; |
import 'package:front_end/src/base/performace_logger.dart'; |
import 'package:front_end/src/incremental/byte_store.dart'; |
@@ -42,15 +42,6 @@ Element findChildElement(Element root, String name, [ElementKind kind]) { |
} |
/** |
- * Search the [unit] for the [Element]s with the given [name]. |
- */ |
-List<Element> findElementsByName(CompilationUnit unit, String name) { |
- var finder = new _ElementsByNameFinder(name); |
- unit.accept(finder); |
- return finder.elements; |
-} |
- |
-/** |
* A function to be called for every [Element]. |
*/ |
typedef void _ElementVisitorFunction(Element element); |
@@ -189,20 +180,6 @@ class PrintLogger implements Logger { |
} |
} |
-class _ElementsByNameFinder extends RecursiveAstVisitor<Null> { |
- final String name; |
- final List<Element> elements = []; |
- |
- _ElementsByNameFinder(this.name); |
- |
- @override |
- visitSimpleIdentifier(SimpleIdentifier node) { |
- if (node.name == name && node.inDeclarationContext()) { |
- elements.add(node.staticElement); |
- } |
- } |
-} |
- |
/** |
* Wraps the given [_ElementVisitorFunction] into an instance of |
* [engine.GeneralizingElementVisitor]. |