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 test.services.completion.dart.util; | 5 library test.services.completion.dart.util; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol | 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol |
10 show Element, ElementKind; | 10 show Element, ElementKind; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 CompletionSuggestion assertSuggestEnum(String completion, | 209 CompletionSuggestion assertSuggestEnum(String completion, |
210 {bool isDeprecated: false}) { | 210 {bool isDeprecated: false}) { |
211 CompletionSuggestion suggestion = | 211 CompletionSuggestion suggestion = |
212 assertSuggest(completion, isDeprecated: isDeprecated); | 212 assertSuggest(completion, isDeprecated: isDeprecated); |
213 expect(suggestion.isDeprecated, isDeprecated); | 213 expect(suggestion.isDeprecated, isDeprecated); |
214 expect(suggestion.element.kind, protocol.ElementKind.ENUM); | 214 expect(suggestion.element.kind, protocol.ElementKind.ENUM); |
215 return suggestion; | 215 return suggestion; |
216 } | 216 } |
217 | 217 |
218 CompletionSuggestion assertSuggestEnumConst(String completion, | 218 CompletionSuggestion assertSuggestEnumConst(String completion, |
219 {bool isDeprecated: false}) { | 219 {int relevance: DART_RELEVANCE_DEFAULT, bool isDeprecated: false}) { |
220 CompletionSuggestion suggestion = | 220 CompletionSuggestion suggestion = |
221 assertSuggest(completion, isDeprecated: isDeprecated); | 221 assertSuggest(completion, relevance: relevance, isDeprecated: isDeprecat
ed); |
| 222 expect(suggestion.completion, completion); |
222 expect(suggestion.isDeprecated, isDeprecated); | 223 expect(suggestion.isDeprecated, isDeprecated); |
223 expect(suggestion.element.kind, protocol.ElementKind.ENUM_CONSTANT); | 224 expect(suggestion.element.kind, protocol.ElementKind.ENUM_CONSTANT); |
224 return suggestion; | 225 return suggestion; |
225 } | 226 } |
226 | 227 |
227 CompletionSuggestion assertSuggestField(String name, String type, | 228 CompletionSuggestion assertSuggestField(String name, String type, |
228 {int relevance: DART_RELEVANCE_DEFAULT, | 229 {int relevance: DART_RELEVANCE_DEFAULT, |
229 String importUri, | 230 String importUri, |
230 CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, | 231 CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, |
231 bool isDeprecated: false}) { | 232 bool isDeprecated: false}) { |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 } | 559 } |
559 | 560 |
560 @override | 561 @override |
561 void setUp() { | 562 void setUp() { |
562 super.setUp(); | 563 super.setUp(); |
563 index = createMemoryIndex(); | 564 index = createMemoryIndex(); |
564 searchEngine = new SearchEngineImpl(index); | 565 searchEngine = new SearchEngineImpl(index); |
565 contributor = createContributor(); | 566 contributor = createContributor(); |
566 } | 567 } |
567 } | 568 } |
OLD | NEW |