| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library services.completion.dart.sorter; | |
| 6 | |
| 7 import 'dart:async'; | 5 import 'dart:async'; |
| 8 | 6 |
| 9 import 'package:analysis_server/protocol/protocol_generated.dart'; | |
| 10 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 7 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
| 8 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
| 11 | 9 |
| 12 /** | 10 /** |
| 13 * The abstract class [DartContributionSorter] defines the behavior of objects | 11 * The abstract class [DartContributionSorter] defines the behavior of objects |
| 14 * that are used to adjust the relevance of an existing list of suggestions. | 12 * that are used to adjust the relevance of an existing list of suggestions. |
| 15 * This is a long-lived object that should not maintain state between | 13 * This is a long-lived object that should not maintain state between |
| 16 * calls to it's [sort] method. | 14 * calls to it's [sort] method. |
| 17 */ | 15 */ |
| 18 abstract class DartContributionSorter { | 16 abstract class DartContributionSorter { |
| 19 /** | 17 /** |
| 20 * After [CompletionSuggestion]s have been computed, | 18 * After [CompletionSuggestion]s have been computed, |
| 21 * this method is called to adjust the relevance of those suggestions. | 19 * this method is called to adjust the relevance of those suggestions. |
| 22 * Return a [Future] that completes when the suggestions have been updated. | 20 * Return a [Future] that completes when the suggestions have been updated. |
| 23 */ | 21 */ |
| 24 Future sort(DartCompletionRequest request, | 22 Future sort(DartCompletionRequest request, |
| 25 Iterable<CompletionSuggestion> suggestions); | 23 Iterable<CompletionSuggestion> suggestions); |
| 26 } | 24 } |
| OLD | NEW |