Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: pkg/analysis_server/lib/src/search/search_domain.dart

Issue 2526473003: Make AnalysisSErver APIs to access unit/node/element asynchronous. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698