| 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 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 assertNotSuggested('f'); | 1098 assertNotSuggested('f'); |
| 1099 assertNotSuggested('x'); | 1099 assertNotSuggested('x'); |
| 1100 assertNotSuggested('foo'); | 1100 assertNotSuggested('foo'); |
| 1101 assertNotSuggested('F1'); | 1101 assertNotSuggested('F1'); |
| 1102 assertNotSuggested('F2'); | 1102 assertNotSuggested('F2'); |
| 1103 assertNotSuggested('T1'); | 1103 assertNotSuggested('T1'); |
| 1104 assertNotSuggested('T2'); | 1104 assertNotSuggested('T2'); |
| 1105 }); | 1105 }); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 test_InterpolationExpression() { | 1108 // test_InterpolationExpression() { |
| 1109 // SimpleIdentifier InterpolationExpression StringInterpolation | 1109 // // SimpleIdentifier InterpolationExpression StringInterpolation |
| 1110 addTestSource('main() {String name; print("hello \$^");}'); | 1110 // addTestSource('main() {String name; print("hello \$^");}'); |
| 1111 computeFast(); | 1111 // computeFast(); |
| 1112 return computeFull(true).then((_) { | 1112 // return computeFull(true).then((_) { |
| 1113 assertSuggestLocalVariable('name', 'String'); | 1113 // assertSuggestLocalVariable('name', 'String'); |
| 1114 assertSuggestImportedClass('Object'); | 1114 // assertSuggestImportedClass('Object'); |
| 1115 }); | 1115 // }); |
| 1116 } | 1116 // } |
| 1117 | 1117 |
| 1118 test_InterpolationExpression_block() { | 1118 // test_InterpolationExpression_block() { |
| 1119 // SimpleIdentifier InterpolationExpression StringInterpolation | 1119 // // SimpleIdentifier InterpolationExpression StringInterpolation |
| 1120 addTestSource('main() {String name; print("hello \${n^}");}'); | 1120 // addTestSource('main() {String name; print("hello \${n^}");}'); |
| 1121 computeFast(); | 1121 // computeFast(); |
| 1122 return computeFull(true).then((_) { | 1122 // return computeFull(true).then((_) { |
| 1123 assertSuggestLocalVariable('name', 'String'); | 1123 // assertSuggestLocalVariable('name', 'String'); |
| 1124 assertSuggestImportedClass('Object'); | 1124 // assertSuggestImportedClass('Object'); |
| 1125 }); | 1125 // }); |
| 1126 } | 1126 // } |
| 1127 | 1127 |
| 1128 test_InterpolationExpression_prefix_selector() { | 1128 test_InterpolationExpression_prefix_selector() { |
| 1129 // SimpleIdentifier PrefixedIdentifier InterpolationExpression | 1129 // SimpleIdentifier PrefixedIdentifier InterpolationExpression |
| 1130 addTestSource('main() {String name; print("hello \${name.^}");}'); | 1130 addTestSource('main() {String name; print("hello \${name.^}");}'); |
| 1131 computeFast(); | 1131 computeFast(); |
| 1132 return computeFull(true).then((_) { | 1132 return computeFull(true).then((_) { |
| 1133 assertSuggestInvocationGetter('length', 'int'); | 1133 assertSuggestInvocationGetter('length', 'int'); |
| 1134 assertNotSuggested('name'); | 1134 assertNotSuggested('name'); |
| 1135 assertNotSuggested('Object'); | 1135 assertNotSuggested('Object'); |
| 1136 }); | 1136 }); |
| 1137 } | 1137 } |
| 1138 | 1138 |
| 1139 test_InterpolationExpression_prefix_target() { | 1139 // test_InterpolationExpression_prefix_target() { |
| 1140 // SimpleIdentifier PrefixedIdentifier InterpolationExpression | 1140 // // SimpleIdentifier PrefixedIdentifier InterpolationExpression |
| 1141 addTestSource('main() {String name; print("hello \${nam^e.length}");}'); | 1141 // addTestSource('main() {String name; print("hello \${nam^e.length}");}'); |
| 1142 computeFast(); | 1142 // computeFast(); |
| 1143 return computeFull(true).then((_) { | 1143 // return computeFull(true).then((_) { |
| 1144 assertSuggestLocalVariable('name', 'String'); | 1144 // assertSuggestLocalVariable('name', 'String'); |
| 1145 assertSuggestImportedClass('Object'); | 1145 // assertSuggestImportedClass('Object'); |
| 1146 assertNotSuggested('length'); | 1146 // assertNotSuggested('length'); |
| 1147 }); | 1147 // }); |
| 1148 } | 1148 // } |
| 1149 | 1149 |
| 1150 test_IsExpression() { | 1150 test_IsExpression() { |
| 1151 // SimpleIdentifier TypeName IsExpression IfStatement | 1151 // SimpleIdentifier TypeName IsExpression IfStatement |
| 1152 addSource('/testB.dart', ''' | 1152 addSource('/testB.dart', ''' |
| 1153 lib B; | 1153 lib B; |
| 1154 foo() { } | 1154 foo() { } |
| 1155 class X {X.c(); X._d(); z() {}}'''); | 1155 class X {X.c(); X._d(); z() {}}'''); |
| 1156 addTestSource(''' | 1156 addTestSource(''' |
| 1157 import "/testB.dart"; | 1157 import "/testB.dart"; |
| 1158 class Y {Y.c(); Y._d(); z() {}} | 1158 class Y {Y.c(); Y._d(); z() {}} |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 class X {X.c(); X._d(); z() {}}'''); | 1451 class X {X.c(); X._d(); z() {}}'''); |
| 1452 addTestSource(''' | 1452 addTestSource(''' |
| 1453 import "/testB.dart"; | 1453 import "/testB.dart"; |
| 1454 class Y {Y.c(); Y._d(); z() {}} | 1454 class Y {Y.c(); Y._d(); z() {}} |
| 1455 main() {var ^}'''); | 1455 main() {var ^}'''); |
| 1456 computeFast(); | 1456 computeFast(); |
| 1457 return computeFull(true).then((_) { | 1457 return computeFull(true).then((_) { |
| 1458 assertNoSuggestions(); | 1458 assertNoSuggestions(); |
| 1459 }); | 1459 }); |
| 1460 } | 1460 } |
| 1461 |
| 1462 // test_ConditionalExpression() { |
| 1463 // fail('not implemented yet'); |
| 1464 // } |
| 1465 // |
| 1466 // test_FunctionExpression() { |
| 1467 // fail('not implemented yet'); |
| 1468 // } |
| 1469 // |
| 1470 // test_FunctionExpressionInvocation() { |
| 1471 // fail('not implemented yet'); |
| 1472 // } |
| 1473 // |
| 1474 // test_Identifier() { |
| 1475 // fail('not implemented yet'); |
| 1476 // } |
| 1477 // |
| 1478 // test_IndexExpression() { |
| 1479 // fail('not implemented yet'); |
| 1480 // } |
| 1481 // |
| 1482 // test_InstanceCreationExpression() { |
| 1483 // fail('not implemented yet'); |
| 1484 // } |
| 1485 // |
| 1486 // test_Literal() { |
| 1487 // fail('not implemented yet'); |
| 1488 // } |
| 1489 // |
| 1490 // test_MethodInvocation() { |
| 1491 // fail('not implemented yet'); |
| 1492 // } |
| 1493 // |
| 1494 // test_NamedExpression() { |
| 1495 // fail('not implemented yet'); |
| 1496 // } |
| 1497 // |
| 1498 // test_ParenthesizedExpression() { |
| 1499 // fail('not implemented yet'); |
| 1500 // } |
| 1501 // |
| 1502 // test_PostfixExpression() { |
| 1503 // fail('not implemented yet'); |
| 1504 // } |
| 1505 // |
| 1506 // test_PrefixedIdentifier() { |
| 1507 // fail('not implemented yet'); |
| 1508 // } |
| 1509 // |
| 1510 // test_PrefixedExpression() { |
| 1511 // fail('not implemented yet'); |
| 1512 // } |
| 1513 // |
| 1514 // test_PropertyAccess() { |
| 1515 // fail('not implemented yet'); |
| 1516 // } |
| 1517 // |
| 1518 // test_RethrowExpression() { |
| 1519 // fail('not implemented yet'); |
| 1520 // } |
| 1521 // |
| 1522 // test_SuperExpression() { |
| 1523 // fail('not implemented yet'); |
| 1524 // } |
| 1525 // |
| 1526 // test_ThisExpression() { |
| 1527 // fail('not implemented yet'); |
| 1528 // } |
| 1529 // |
| 1530 // test_ThrowExpression() { |
| 1531 // fail('not implemented yet'); |
| 1532 // } |
| 1461 } | 1533 } |
| OLD | NEW |