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

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

Issue 1318543002: Convert completion API to be future based (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
Index: pkg/analysis_server/lib/src/domain_completion.dart
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index a956a7dd5421715e437bef072a7284c189dbc8cb..23536e21957bec1c2f2b51331beb3ad8889bba84 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -192,15 +192,16 @@ class CompletionDomainHandler implements RequestHandler {
int notificationCount = 0;
manager.results(completionRequest).listen((CompletionResult result) {
++notificationCount;
+ bool isLast = result is CompletionResultImpl ? result.isLast : true;
performance.logElapseTime("notification $notificationCount send", () {
sendCompletionNotification(completionId, result.replacementOffset,
- result.replacementLength, result.suggestions, result.isLast);
+ result.replacementLength, result.suggestions, isLast);
});
if (notificationCount == 1) {
performance.logFirstNotificationComplete('notification 1 complete');
performance.suggestionCountFirst = result.suggestions.length;
}
- if (result.isLast) {
+ if (isLast) {
performance.notificationCount = notificationCount;
performance.suggestionCountLast = result.suggestions.length;
performance.complete();

Powered by Google App Engine
This is Rietveld 408576698