| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 CompletionSuggestion suggestion = assertSuggestSetter('t'); | 135 CompletionSuggestion suggestion = assertSuggestSetter('t'); |
| 136 expect(suggestion.element.parameters, '(int value)'); | 136 expect(suggestion.element.parameters, '(int value)'); |
| 137 }); | 137 }); |
| 138 } | 138 } |
| 139 | 139 |
| 140 test_libraryPrefix() { | 140 test_libraryPrefix() { |
| 141 // SimpleIdentifier PrefixedIdentifier ExpressionStatement | 141 // SimpleIdentifier PrefixedIdentifier ExpressionStatement |
| 142 addTestSource('import "dart:async" as bar; foo() {bar.^}'); | 142 addTestSource('import "dart:async" as bar; foo() {bar.^}'); |
| 143 return computeFull((bool result) { | 143 return computeFull((bool result) { |
| 144 assertSuggestClass('Future'); | 144 assertSuggestClass('Future'); |
| 145 assertNotSuggested('loadLibrary'); |
| 145 }); | 146 }); |
| 146 } | 147 } |
| 147 | 148 |
| 148 test_libraryPrefix2() { | 149 test_libraryPrefix2() { |
| 149 // SimpleIdentifier MethodInvocation ExpressionStatement | 150 // SimpleIdentifier MethodInvocation ExpressionStatement |
| 150 addTestSource('import "dart:async" as bar; foo() {bar.^ print("f")}'); | 151 addTestSource('import "dart:async" as bar; foo() {bar.^ print("f")}'); |
| 151 return computeFull((bool result) { | 152 return computeFull((bool result) { |
| 152 assertSuggestClass('Future'); | 153 assertSuggestClass('Future'); |
| 153 }); | 154 }); |
| 154 } | 155 } |
| 155 | 156 |
| 157 test_libraryPrefix_deferred() { |
| 158 // SimpleIdentifier PrefixedIdentifier ExpressionStatement |
| 159 addTestSource('import "dart:async" deferred as bar; foo() {bar.^}'); |
| 160 return computeFull((bool result) { |
| 161 assertSuggestClass('Future'); |
| 162 assertSuggestFunction('loadLibrary', 'void'); |
| 163 }); |
| 164 } |
| 165 |
| 156 test_local() { | 166 test_local() { |
| 157 addTestSource('foo() {String x = "bar"; x.^}'); | 167 addTestSource('foo() {String x = "bar"; x.^}'); |
| 158 return computeFull((bool result) { | 168 return computeFull((bool result) { |
| 159 assertSuggestGetter('length', 'int'); | 169 assertSuggestGetter('length', 'int'); |
| 160 }); | 170 }); |
| 161 } | 171 } |
| 162 | 172 |
| 163 test_local_is() { | 173 test_local_is() { |
| 164 addTestSource('foo() {var x; if (x is String) x.^}'); | 174 addTestSource('foo() {var x; if (x is String) x.^}'); |
| 165 return computeFull((bool result) { | 175 return computeFull((bool result) { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 } | 517 } |
| 508 void test(Derived d) { | 518 void test(Derived d) { |
| 509 d.^ | 519 d.^ |
| 510 } | 520 } |
| 511 '''); | 521 '''); |
| 512 return computeFull((bool result) { | 522 return computeFull((bool result) { |
| 513 assertSuggestMethod('f', 'Base', 'void'); | 523 assertSuggestMethod('f', 'Base', 'void'); |
| 514 }); | 524 }); |
| 515 } | 525 } |
| 516 } | 526 } |
| OLD | NEW |