| 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.util; | 5 library test.services.completion.util; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, | 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, |
| 10 ElementKind; | 10 ElementKind; |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 addTestSource(''' | 1264 addTestSource(''' |
| 1265 import "/testAB.dart" show ^; | 1265 import "/testAB.dart" show ^; |
| 1266 import "/testCD.dart"; | 1266 import "/testCD.dart"; |
| 1267 class X {}'''); | 1267 class X {}'''); |
| 1268 computeFast(); | 1268 computeFast(); |
| 1269 return computeFull((bool result) { | 1269 return computeFull((bool result) { |
| 1270 assertNoSuggestions(); | 1270 assertNoSuggestions(); |
| 1271 }); | 1271 }); |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 test_ConditionalExpression_empty() { |
| 1275 // SimpleIdentifier PrefixIdentifier IfStatement |
| 1276 addTestSource(''' |
| 1277 class A {var b; X _c; foo() {A a; if (^) something}}'''); |
| 1278 computeFast(); |
| 1279 return computeFull((bool result) { |
| 1280 assertSuggestLocalGetter('b', null); |
| 1281 assertSuggestLocalGetter('_c', 'X'); |
| 1282 assertSuggestImportedClass('Object'); |
| 1283 assertSuggestLocalClass('A'); |
| 1284 assertNotSuggested('=='); |
| 1285 }); |
| 1286 } |
| 1287 |
| 1288 test_ConditionalExpression_invocation() { |
| 1289 // SimpleIdentifier PrefixIdentifier IfStatement |
| 1290 addTestSource(''' |
| 1291 main() {var a; if (a.^) something}'''); |
| 1292 computeFast(); |
| 1293 return computeFull((bool result) { |
| 1294 assertSuggestInvocationMethod('toString', 'Object', 'String'); |
| 1295 //TODO (danrubel) type for '_c' should be 'X' not null |
| 1296 assertNotSuggested('Object'); |
| 1297 assertNotSuggested('A'); |
| 1298 assertNotSuggested('=='); |
| 1299 }); |
| 1300 } |
| 1301 |
| 1274 test_ConstructorName_importedClass() { | 1302 test_ConstructorName_importedClass() { |
| 1275 // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName | 1303 // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName |
| 1276 // InstanceCreationExpression | 1304 // InstanceCreationExpression |
| 1277 addSource('/testB.dart', ''' | 1305 addSource('/testB.dart', ''' |
| 1278 lib B; | 1306 lib B; |
| 1279 int T1; | 1307 int T1; |
| 1280 F1() { } | 1308 F1() { } |
| 1281 class X {X.c(); X._d(); z() {}}'''); | 1309 class X {X.c(); X._d(); z() {}}'''); |
| 1282 addTestSource(''' | 1310 addTestSource(''' |
| 1283 import "/testB.dart"; | 1311 import "/testB.dart"; |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2057 assertNotSuggested('bar2'); | 2085 assertNotSuggested('bar2'); |
| 2058 assertNotSuggested('_B'); | 2086 assertNotSuggested('_B'); |
| 2059 assertSuggestLocalClass('Y'); | 2087 assertSuggestLocalClass('Y'); |
| 2060 assertSuggestLocalClass('C'); | 2088 assertSuggestLocalClass('C'); |
| 2061 assertSuggestLocalVariable('f', null); | 2089 assertSuggestLocalVariable('f', null); |
| 2062 assertNotSuggested('x'); | 2090 assertNotSuggested('x'); |
| 2063 assertNotSuggested('e'); | 2091 assertNotSuggested('e'); |
| 2064 }); | 2092 }); |
| 2065 } | 2093 } |
| 2066 } | 2094 } |
| OLD | NEW |