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

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

Issue 875163002: Make AnalysisServer.onAnalysisComplete a Future and wait for it before refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 139048371770a77bb839b809f3741ae7d531782b..42d826846751fa4e55fd363867940969bf4afe8b 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -177,11 +177,6 @@ class AnalysisServer {
StreamController<AnalysisContext> _onAnalysisStartedController;
/**
- * The controller that is notified when analysis is complete.
- */
- StreamController _onAnalysisCompleteController;
-
- /**
* The controller that is notified when a single file has been analyzed.
*/
StreamController<ChangeNotice> _onFileAnalyzedController;
@@ -231,7 +226,6 @@ class AnalysisServer {
_noErrorNotification = analysisServerOptions.noErrorNotification;
AnalysisEngine.instance.logger = new AnalysisLogger();
_onAnalysisStartedController = new StreamController.broadcast();
- _onAnalysisCompleteController = new StreamController.broadcast();
_onFileAnalyzedController = new StreamController.broadcast();
_onPriorityChangeController =
new StreamController<PriorityChangeEvent>.broadcast();
@@ -242,9 +236,14 @@ class AnalysisServer {
}
/**
- * The stream that is notified when analysis is complete.
+ * The [Future] that completes when analysis is complete.
*/
- Stream get onAnalysisComplete => _onAnalysisCompleteController.stream;
+ Future get onAnalysisComplete {
+ if (isAnalysisComplete()) {
+ return new Future.value();
+ }
+ return new Future(() => onAnalysisComplete);
Brian Wilkerson 2015/01/26 21:26:32 This concerns me. Given what I think I know about
scheglov 2015/01/26 22:05:53 Acknowledged.
+ }
/**
* The stream that is notified when analysis of a context is started.
@@ -632,7 +631,6 @@ class AnalysisServer {
_schedulePerformOperation();
} else {
sendStatusNotification(null);
- _onAnalysisCompleteController.add(null);
}
}
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698