Remove the unused class DartContributionSorter

This was used by the ML support, which has been removed.

Change-Id: Idedb04e31c7b859f8ac0e590fd722958ce40d9ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Brian Wilkerson 2021-02-01 00:23:59 +00:00 committed by commit-bot@chromium.org
parent 388b6ff746
commit d1882b6bea
2 changed files with 0 additions and 33 deletions

View file

@ -1,18 +0,0 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
/// The abstract class [DartContributionSorter] defines the behavior of objects
/// that are used to adjust the relevance of an existing list of suggestions.
/// This is a long-lived object that should not maintain state between
/// calls to it's [sort] method.
abstract class DartContributionSorter {
/// After [CompletionSuggestion]s have been computed,
/// this method is called to adjust the relevance of those suggestions.
/// Return a [Future] that completes when the suggestions have been updated.
Future sort(DartCompletionRequest request,
Iterable<CompletionSuggestion> suggestions);
}

View file

@ -4,9 +4,7 @@
import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analysis_server/src/plugin/plugin_manager.dart';
import 'package:analysis_server/src/provisional/completion/completion_core.dart';
import 'package:analysis_server/src/provisional/completion/dart/completion_dart.dart';
import 'package:analysis_server/src/services/completion/dart/contribution_sorter.dart';
import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
@ -776,16 +774,3 @@ class B extends A {m() {^}}
});
}
}
class MockRelevancySorter implements DartContributionSorter {
bool enabled = true;
@override
Future sort(
CompletionRequest request, Iterable<CompletionSuggestion> suggestions) {
if (!enabled) {
throw 'unexpected sort';
}
return Future.value();
}
}