| 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 | |
| 109 test_enumConst() { | 91 test_enumConst() { |
| 110 addTestSource('enum E { one, two } main() {E.^}'); | 92 addTestSource('enum E { one, two } main() {E.^}'); |
| 111 return computeFull((bool result) { | 93 return computeFull((bool result) { |
| 112 assertNotSuggested('E'); | 94 assertNotSuggested('E'); |
| 113 assertSuggestEnumConst('one'); | 95 assertSuggestEnumConst('one'); |
| 114 assertSuggestEnumConst('two'); | 96 assertSuggestEnumConst('two'); |
| 115 assertNotSuggested('index'); | 97 assertNotSuggested('index'); |
| 116 assertSuggestField('values', 'List<E>'); | 98 assertSuggestField('values', 'List<E>'); |
| 117 }); | 99 }); |
| 118 } | 100 } |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 assertNotSuggested('ms2'); | 666 assertNotSuggested('ms2'); |
| 685 assertSuggestInvocationMethod('m', 'C2', null, | 667 assertSuggestInvocationMethod('m', 'C2', null, |
| 686 relevance: DART_RELEVANCE_HIGH); | 668 relevance: DART_RELEVANCE_HIGH); |
| 687 assertNotSuggested('fi3'); | 669 assertNotSuggested('fi3'); |
| 688 assertNotSuggested('fs3'); | 670 assertNotSuggested('fs3'); |
| 689 assertNotSuggested('mi3'); | 671 assertNotSuggested('mi3'); |
| 690 assertNotSuggested('ms3'); | 672 assertNotSuggested('ms3'); |
| 691 }); | 673 }); |
| 692 } | 674 } |
| 693 } | 675 } |
| OLD | NEW |