| 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.domain.completion; | 5 library test.domain.completion; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/domain_completion.dart'; | 10 import 'package:analysis_server/src/domain_completion.dart'; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'one: ', | 44 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'one: ', |
| 45 relevance: DART_RELEVANCE_NAMED_PARAMETER); | 45 relevance: DART_RELEVANCE_NAMED_PARAMETER); |
| 46 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ', | 46 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'two: ', |
| 47 relevance: DART_RELEVANCE_NAMED_PARAMETER); | 47 relevance: DART_RELEVANCE_NAMED_PARAMETER); |
| 48 expect(suggestions, hasLength(2)); | 48 expect(suggestions, hasLength(2)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 test_ArgumentList_imported_function_named_param_label1() async { | 51 test_ArgumentList_imported_function_named_param_label1() async { |
| 52 addTestFile('main() { int.parse("16", r^: 16);}'); | 52 addTestFile('main() { int.parse("16", r^: 16);}'); |
| 53 await getSuggestions(); | 53 await getSuggestions(); |
| 54 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'radix: ', | 54 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'radix', |
| 55 relevance: DART_RELEVANCE_NAMED_PARAMETER); | 55 relevance: DART_RELEVANCE_NAMED_PARAMETER); |
| 56 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'onError: ', | 56 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'onError', |
| 57 relevance: DART_RELEVANCE_NAMED_PARAMETER); | 57 relevance: DART_RELEVANCE_NAMED_PARAMETER); |
| 58 expect(suggestions, hasLength(2)); | 58 expect(suggestions, hasLength(2)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 test_ArgumentList_imported_function_named_param_label3() async { | 61 test_ArgumentList_imported_function_named_param_label3() async { |
| 62 addTestFile('main() { int.parse("16", ^: 16);}'); | 62 addTestFile('main() { int.parse("16", ^: 16);}'); |
| 63 await getSuggestions(); | 63 await getSuggestions(); |
| 64 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'radix: ', | 64 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'radix: ', |
| 65 relevance: DART_RELEVANCE_NAMED_PARAMETER); | 65 relevance: DART_RELEVANCE_NAMED_PARAMETER); |
| 66 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'onError: ', | 66 assertHasResult(CompletionSuggestionKind.NAMED_ARGUMENT, 'onError: ', |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 } | 606 } |
| 607 '''); | 607 '''); |
| 608 await waitForTasksFinished(); | 608 await waitForTasksFinished(); |
| 609 Request request = | 609 Request request = |
| 610 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); | 610 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); |
| 611 Response response = handler.handleRequest(request); | 611 Response response = handler.handleRequest(request); |
| 612 expect(response.error, isNotNull); | 612 expect(response.error, isNotNull); |
| 613 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); | 613 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); |
| 614 } | 614 } |
| 615 } | 615 } |
| OLD | NEW |