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

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

Issue 1539693002: move DartCompletionSorter to dart specific contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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
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 eaf7ee5f67fd3e16bbda657e732a4396a6c34559..92bd9b0e0ab260f4cb8937894712c7f34404b1ec 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
@@ -11,8 +11,6 @@ import 'package:analysis_server/src/provisional/completion/completion_core.dart'
show AnalysisRequest, CompletionContributor, CompletionRequest;
import 'package:analysis_server/src/services/completion/completion_core.dart';
import 'package:analysis_server/src/services/completion/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/dart/common_usage_sorter.dart';
-import 'package:analysis_server/src/services/completion/dart/contribution_sorter.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/generated/ast.dart';
@@ -46,27 +44,16 @@ abstract class DartCompletionContributor {
* Manages code completion for a given Dart file completion request.
*/
class DartCompletionManager extends CompletionManager {
- /**
- * The [defaultContributionSorter] is a long-lived object that isn't allowed
- * to maintain state between calls to [ContributionSorter#sort(...)].
- */
- static DartContributionSorter defaultContributionSorter =
- new CommonUsageSorter();
-
final SearchEngine searchEngine;
Iterable<CompletionContributor> newContributors;
- DartContributionSorter contributionSorter;
DartCompletionManager(
AnalysisContext context, this.searchEngine, Source source,
- [this.newContributors, this.contributionSorter])
+ [this.newContributors])
: super(context, source) {
if (newContributors == null) {
newContributors = <CompletionContributor>[];
}
- if (contributionSorter == null) {
- contributionSorter = defaultContributionSorter;
- }
}
/**
@@ -115,11 +102,6 @@ class DartCompletionManager extends CompletionManager {
performance.logElapseTime('computeSuggestions');
performance.logStartTime('waitForAnalysis');
- // TODO(danrubel) current sorter requires no additional analysis,
- // but need to handle the returned future the same way that futures
- // returned from contributors are handled once this method is refactored
- // to be async.
- /* await */ contributionSorter.sort(request, request.suggestions);
// TODO (danrubel) if request is obsolete
// (processAnalysisRequest returns false)
// then send empty results

Powered by Google App Engine
This is Rietveld 408576698