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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart

Issue 774033003: skip completion if client closed stream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
index 023ee55937fa305bcca03aec2f174b2464e9ac6c..e2c9cdcbf525a25f5c5e87147931e61e3f6897fc 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart
@@ -116,6 +116,9 @@ class DartCompletionManager extends CompletionManager {
List<DartCompletionComputer> todo) {
request.performance.logStartTime('waitForAnalysis');
waitForAnalysis().then((CompilationUnit unit) {
+ if (controller.isClosed) {
+ return;
+ }
request.performance.logElapseTime('waitForAnalysis');
if (unit == null) {
sendResults(request, true);
@@ -164,6 +167,9 @@ class DartCompletionManager extends CompletionManager {
* Send the current list of suggestions to the client.
*/
void sendResults(DartCompletionRequest request, bool last) {
+ if (controller.isClosed) {
+ return;
+ }
controller.add(
new CompletionResult(
request.replacementOffset,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698