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 1dfe7b3600bfc871370795e51bb8a8d6bc4a4cd4..3bdcdd17b10ccf1ac023c837c8c909c4153f5d1e 100644 |
--- a/pkg/analyzer/lib/src/dart/analysis/search.dart |
+++ b/pkg/analyzer/lib/src/dart/analysis/search.dart |
@@ -39,6 +39,9 @@ class Search { |
Future<List<SearchResult>> _searchReferences_Local( |
Element element, bool isRootNode(AstNode n)) async { |
String path = element.source.fullName; |
+ if (!_driver.addedFiles.contains(path)) { |
+ return const <SearchResult>[]; |
+ } |
// Prepare the unit. |
AnalysisResult analysisResult = await _driver.getResult(path); |