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

Unified Diff: pkg/analysis_server/lib/src/domain_analysis.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/domain_analysis.dart
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index 431155ada5e23db6eb0303927603ea319914d394..499fd9955970437209426febd9f342df00d611b9 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -95,7 +95,7 @@ class AnalysisDomainHandler implements RequestHandler {
AnalysisResult result = await server.getAnalysisResult(params.file);
unit = result?.unit;
} else {
- unit = server.getResolvedCompilationUnit(params.file);
+ unit = await server.getResolvedCompilationUnit(params.file);
}
// Prepare the hovers.
@@ -144,10 +144,10 @@ class AnalysisDomainHandler implements RequestHandler {
if (analysisFuture == null) {
return new Response.getNavigationInvalidFile(request);
}
- analysisFuture.then((AnalysisDoneReason reason) {
+ analysisFuture.then((AnalysisDoneReason reason) async {
switch (reason) {
case AnalysisDoneReason.COMPLETE:
- CompilationUnit unit = server.getResolvedCompilationUnit(file);
+ CompilationUnit unit = await server.getResolvedCompilationUnit(file);
if (unit == null) {
server.sendResponse(new Response.getNavigationInvalidFile(request));
} else {

Powered by Google App Engine
This is Rietveld 408576698