Index: pkg/analysis_server/lib/src/search/search_domain.dart |
diff --git a/pkg/analysis_server/lib/src/search/search_domain.dart b/pkg/analysis_server/lib/src/search/search_domain.dart |
index 1109ede3504c3b0ad4c891f4af6a3fa9768550a1..d75ea96efbddb38c939ea46f8aa3ec99b065870e 100644 |
--- a/pkg/analysis_server/lib/src/search/search_domain.dart |
+++ b/pkg/analysis_server/lib/src/search/search_domain.dart |
@@ -60,9 +60,10 @@ class SearchDomainHandler implements protocol.RequestHandler { |
} |
var params = |
new protocol.SearchFindElementReferencesParams.fromRequest(request); |
+ String file = params.file; |
await server.onAnalysisComplete; |
// prepare element |
- Element element = server.getElementAtOffset(params.file, params.offset); |
+ Element element = await server.getElementAtOffset(file, params.offset); |
if (element is ImportElement) { |
element = (element as ImportElement).prefix; |
} |
@@ -162,7 +163,7 @@ class SearchDomainHandler implements protocol.RequestHandler { |
await server.onAnalysisComplete; |
} |
// prepare element |
- Element element = server.getElementAtOffset(file, params.offset); |
+ Element element = await server.getElementAtOffset(file, params.offset); |
if (element == null) { |
_sendTypeHierarchyNull(request); |
return; |