| 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.invocation; | 5 library test.services.completion.invocation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
| 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 return computeFull((bool result) { | 81 return computeFull((bool result) { |
| 82 assertSuggestInvocationGetter('length', 'int'); | 82 assertSuggestInvocationGetter('length', 'int'); |
| 83 }); | 83 }); |
| 84 } | 84 } |
| 85 | 85 |
| 86 @override | 86 @override |
| 87 void setUpContributor() { | 87 void setUpContributor() { |
| 88 contributor = new PrefixedElementContributor(); | 88 contributor = new PrefixedElementContributor(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 test_doc_method() { |
| 92 addTestSource(''' |
| 93 class C { |
| 94 /// My method. |
| 95 /// |
| 96 /// Longer documentation. |
| 97 void m() {} |
| 98 } |
| 99 void main() {new C().^}'''); |
| 100 return computeFull((bool result) { |
| 101 CompletionSuggestion suggestion = assertSuggestMethod('m', 'C', 'void', |
| 102 docSummaryMatcher: 'My method.', |
| 103 docCompleteMatcher: 'My method.\n\nLonger documentation.'); |
| 104 expect(suggestion.requiredParameterCount, 0); |
| 105 expect(suggestion.hasNamedParameters, false); |
| 106 }); |
| 107 } |
| 108 |
| 91 test_enumConst() { | 109 test_enumConst() { |
| 92 addTestSource('enum E { one, two } main() {E.^}'); | 110 addTestSource('enum E { one, two } main() {E.^}'); |
| 93 return computeFull((bool result) { | 111 return computeFull((bool result) { |
| 94 assertNotSuggested('E'); | 112 assertNotSuggested('E'); |
| 95 assertSuggestEnumConst('one'); | 113 assertSuggestEnumConst('one'); |
| 96 assertSuggestEnumConst('two'); | 114 assertSuggestEnumConst('two'); |
| 97 assertNotSuggested('index'); | 115 assertNotSuggested('index'); |
| 98 assertSuggestField('values', 'List<E>'); | 116 assertSuggestField('values', 'List<E>'); |
| 99 }); | 117 }); |
| 100 } | 118 } |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 assertNotSuggested('ms2'); | 684 assertNotSuggested('ms2'); |
| 667 assertSuggestInvocationMethod('m', 'C2', null, | 685 assertSuggestInvocationMethod('m', 'C2', null, |
| 668 relevance: DART_RELEVANCE_HIGH); | 686 relevance: DART_RELEVANCE_HIGH); |
| 669 assertNotSuggested('fi3'); | 687 assertNotSuggested('fi3'); |
| 670 assertNotSuggested('fs3'); | 688 assertNotSuggested('fs3'); |
| 671 assertNotSuggested('mi3'); | 689 assertNotSuggested('mi3'); |
| 672 assertNotSuggested('ms3'); | 690 assertNotSuggested('ms3'); |
| 673 }); | 691 }); |
| 674 } | 692 } |
| 675 } | 693 } |
| OLD | NEW |