| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 expect(element.name, equals(name)); | 362 expect(element.name, equals(name)); |
| 363 String param = element.parameters; | 363 String param = element.parameters; |
| 364 expect(param, isNotNull); | 364 expect(param, isNotNull); |
| 365 expect(param[0], equals('(')); | 365 expect(param[0], equals('(')); |
| 366 expect(param[param.length - 1], equals(')')); | 366 expect(param[param.length - 1], equals(')')); |
| 367 expect(element.returnType, returnType != null ? returnType : 'dynamic'); | 367 expect(element.returnType, returnType != null ? returnType : 'dynamic'); |
| 368 assertHasParameterInfo(cs); | 368 assertHasParameterInfo(cs); |
| 369 return cs; | 369 return cs; |
| 370 } | 370 } |
| 371 | 371 |
| 372 CompletionSuggestion assertSuggestName( |
| 373 String name, |
| 374 {int relevance: DART_RELEVANCE_DEFAULT, |
| 375 String importUri, |
| 376 CompletionSuggestionKind kind: CompletionSuggestionKind.IDENTIFIER, |
| 377 bool isDeprecated: false}) { |
| 378 CompletionSuggestion cs = assertSuggest(name, |
| 379 csKind: kind, |
| 380 relevance: relevance, |
| 381 importUri: importUri, |
| 382 isDeprecated: isDeprecated); |
| 383 expect(cs.completion, equals(name)); |
| 384 expect(cs.element, isNull); |
| 385 assertHasNoParameterInfo(cs); |
| 386 return cs; |
| 387 } |
| 388 |
| 372 CompletionSuggestion assertSuggestSetter(String name, | 389 CompletionSuggestion assertSuggestSetter(String name, |
| 373 {int relevance: DART_RELEVANCE_DEFAULT, | 390 {int relevance: DART_RELEVANCE_DEFAULT, |
| 374 String importUri, | 391 String importUri, |
| 375 CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION}) { | 392 CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION}) { |
| 376 CompletionSuggestion cs = assertSuggest(name, | 393 CompletionSuggestion cs = assertSuggest(name, |
| 377 csKind: kind, | 394 csKind: kind, |
| 378 relevance: relevance, | 395 relevance: relevance, |
| 379 importUri: importUri, | 396 importUri: importUri, |
| 380 elemKind: protocol.ElementKind.SETTER); | 397 elemKind: protocol.ElementKind.SETTER); |
| 381 protocol.Element element = cs.element; | 398 protocol.Element element = cs.element; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 } | 567 } |
| 551 | 568 |
| 552 @override | 569 @override |
| 553 void setUp() { | 570 void setUp() { |
| 554 super.setUp(); | 571 super.setUp(); |
| 555 index = createMemoryIndex(); | 572 index = createMemoryIndex(); |
| 556 searchEngine = new SearchEngineImpl(index); | 573 searchEngine = new SearchEngineImpl(index); |
| 557 contributor = createContributor(); | 574 contributor = createContributor(); |
| 558 } | 575 } |
| 559 } | 576 } |
| OLD | NEW |