| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_generated.dart'; | 8 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 9 import 'package:analysis_server/src/plugin/plugin_manager.dart'; | 9 import 'package:analysis_server/src/plugin/plugin_manager.dart'; |
| 10 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
; | 10 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
; |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 } | 698 } |
| 699 | 699 |
| 700 test_sentToPlugins() async { | 700 test_sentToPlugins() async { |
| 701 addTestFile(''' | 701 addTestFile(''' |
| 702 void main() { | 702 void main() { |
| 703 ^ | 703 ^ |
| 704 } | 704 } |
| 705 '''); | 705 '''); |
| 706 PluginInfo info = new DiscoveredPluginInfo('a', 'b', 'c', null, null); | 706 PluginInfo info = new DiscoveredPluginInfo('a', 'b', 'c', null, null); |
| 707 plugin.CompletionGetSuggestionsResult result = | 707 plugin.CompletionGetSuggestionsResult result = |
| 708 new plugin.CompletionGetSuggestionsResult(1, 2, <CompletionSuggestion>[ | 708 new plugin.CompletionGetSuggestionsResult( |
| 709 testFile.indexOf('^'), 0, <CompletionSuggestion>[ |
| 709 new CompletionSuggestion(CompletionSuggestionKind.IDENTIFIER, | 710 new CompletionSuggestion(CompletionSuggestionKind.IDENTIFIER, |
| 710 DART_RELEVANCE_DEFAULT, 'plugin completion', 3, 0, false, false) | 711 DART_RELEVANCE_DEFAULT, 'plugin completion', 3, 0, false, false) |
| 711 ]); | 712 ]); |
| 712 pluginManager.broadcastResults = <PluginInfo, Future<plugin.Response>>{ | 713 pluginManager.broadcastResults = <PluginInfo, Future<plugin.Response>>{ |
| 713 info: new Future.value(result.toResponse('-', 1)) | 714 info: new Future.value(result.toResponse('-', 1)) |
| 714 }; | 715 }; |
| 715 await getSuggestions(); | 716 await getSuggestions(); |
| 716 assertHasResult(CompletionSuggestionKind.IDENTIFIER, 'plugin completion', | 717 assertHasResult(CompletionSuggestionKind.IDENTIFIER, 'plugin completion', |
| 717 selectionOffset: 3); | 718 selectionOffset: 3); |
| 718 } | 719 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 | 766 |
| 766 @override | 767 @override |
| 767 Future sort( | 768 Future sort( |
| 768 CompletionRequest request, Iterable<CompletionSuggestion> suggestions) { | 769 CompletionRequest request, Iterable<CompletionSuggestion> suggestions) { |
| 769 if (!enabled) { | 770 if (!enabled) { |
| 770 throw 'unexpected sort'; | 771 throw 'unexpected sort'; |
| 771 } | 772 } |
| 772 return new Future.value(); | 773 return new Future.value(); |
| 773 } | 774 } |
| 774 } | 775 } |
| OLD | NEW |