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

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

Issue 1347283005: refactor ContributionSorter to use new API (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 3 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/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 5dad398eb5991a17b13f22e38da5ecabc00bdae2..ae177f28833b0e91174b9f631d564a3d03849c68 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
@@ -9,13 +9,13 @@ import 'dart:async';
import 'package:analysis_server/completion/completion_core.dart'
show CompletionRequest;
import 'package:analysis_server/completion/completion_dart.dart' as newApi;
+import 'package:analysis_server/completion/dart/completion_target.dart';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/services/completion/arglist_contributor.dart';
import 'package:analysis_server/src/services/completion/combinator_contributor.dart';
import 'package:analysis_server/src/services/completion/common_usage_computer.dart';
import 'package:analysis_server/src/services/completion/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/completion_target.dart';
import 'package:analysis_server/src/services/completion/contribution_sorter.dart';
import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
import 'package:analysis_server/src/services/completion/imported_reference_contributor.dart';
@@ -180,7 +180,8 @@ class DartCompletionManager extends CompletionManager {
return c.computeFast(request);
});
});
- contributionSorter.sort(request);
+ contributionSorter.sort(
+ new OldRequestWrapper(request), request.suggestions);
sendResults(request, todo.isEmpty);
return todo;
});
@@ -218,7 +219,8 @@ class DartCompletionManager extends CompletionManager {
performance.logElapseTime(completeTag);
bool last = --count == 0;
if (changed || last) {
- contributionSorter.sort(request);
+ contributionSorter.sort(
+ new OldRequestWrapper(request), request.suggestions);
sendResults(request, last);
}
});
@@ -483,6 +485,9 @@ class OldRequestWrapper implements newApi.DartCompletionRequest {
Source get source => request.source;
@override
+ CompletionTarget get target => request.target;
+
+ @override
CompilationUnit get unit => request.unit;
@override

Powered by Google App Engine
This is Rietveld 408576698