Index: pkg/analysis_server/test/plugin/protocol_dart_test.dart |
diff --git a/pkg/analysis_server/test/plugin/protocol_dart_test.dart b/pkg/analysis_server/test/plugin/protocol_dart_test.dart |
index 6f456409d2498eb1d2925080d44377cff0167669..4e1fff179946f237b14cfae9f0ff5e213a7d8130 100644 |
--- a/pkg/analysis_server/test/plugin/protocol_dart_test.dart |
+++ b/pkg/analysis_server/test/plugin/protocol_dart_test.dart |
@@ -12,6 +12,7 @@ import 'package:analyzer/src/dart/ast/utilities.dart' as engine; |
import 'package:analyzer/src/dart/element/element.dart' as engine; |
import 'package:analyzer/src/error/codes.dart' as engine; |
import 'package:analyzer/src/generated/source.dart' as engine; |
+import 'package:analyzer/src/generated/testing/search.dart'; |
import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
import 'package:test/test.dart'; |
import 'package:test_reflective_loader/test_reflective_loader.dart'; |
@@ -25,16 +26,6 @@ main() { |
}); |
} |
-/** |
- * Search the [unit] for the [engine.Element]s with the given [name]. |
- */ |
-List<engine.Element> findElementsByName( |
- engine.CompilationUnit unit, String name) { |
- var finder = new _ElementsByNameFinder(name); |
- unit.accept(finder); |
- return finder.elements; |
-} |
- |
@reflectiveTest |
class ElementKindTest { |
void test_fromEngine() { |
@@ -488,17 +479,3 @@ class A { |
expect(element.flags, 0); |
} |
} |
- |
-class _ElementsByNameFinder extends engine.RecursiveAstVisitor<Null> { |
- final String name; |
- final List<engine.Element> elements = []; |
- |
- _ElementsByNameFinder(this.name); |
- |
- @override |
- visitSimpleIdentifier(engine.SimpleIdentifier node) { |
- if (node.name == name && node.inDeclarationContext()) { |
- elements.add(node.staticElement); |
- } |
- } |
-} |