Index: pkg/analyzer/lib/src/dart/analysis/search.dart |
diff --git a/pkg/analyzer/lib/src/dart/analysis/search.dart b/pkg/analyzer/lib/src/dart/analysis/search.dart |
index 55d28d61cb6d8caa7fe709d7b7727e228aa1f38f..6cbc37a8cd0182a215c5fb350bb6b49f5023f2b9 100644 |
--- a/pkg/analyzer/lib/src/dart/analysis/search.dart |
+++ b/pkg/analyzer/lib/src/dart/analysis/search.dart |
@@ -60,6 +60,8 @@ class Search { |
return _searchReferences_Local(element, (n) => n is Block); |
} else if (kind == ElementKind.PARAMETER) { |
return _searchReferences_Parameter(element); |
+ } else if (kind == ElementKind.PREFIX) { |
+ return _searchReferences_Prefix(element); |
} else if (kind == ElementKind.TYPE_PARAMETER) { |
return _searchReferences_Local( |
element, (n) => n.parent is CompilationUnit); |
@@ -196,6 +198,21 @@ class Search { |
})); |
return results; |
} |
+ |
+ Future<List<SearchResult>> _searchReferences_Prefix( |
+ PrefixElement element) async { |
+ List<SearchResult> results = <SearchResult>[]; |
+ LibraryElement libraryElement = element.library; |
+ for (CompilationUnitElement unitElement in libraryElement.units) { |
+ String unitPath = unitElement.source.fullName; |
+ AnalysisResult unitAnalysisResult = await _driver.getResult(unitPath); |
+ _LocalReferencesVisitor visitor = |
+ new _LocalReferencesVisitor(element, unitElement); |
+ unitAnalysisResult.unit.accept(visitor); |
+ results.addAll(visitor.results); |
+ } |
+ return results; |
+ } |
} |
/** |