OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/src/dart/analysis/driver.dart'; | 8 import 'package:analyzer/src/dart/analysis/driver.dart'; |
9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
10 import 'package:analyzer_plugin/src/utilities/completion/completion_target.dart'
; | 10 import 'package:analyzer_plugin/src/utilities/completion/completion_target.dart'
; |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 370 |
371 test_InstanceCreationExpression_keyword2() async { | 371 test_InstanceCreationExpression_keyword2() async { |
372 // InstanceCreationExpression ExpressionStatement Block | 372 // InstanceCreationExpression ExpressionStatement Block |
373 await addTestSource('class C {foo(){var f; {var x;} new^ C();}}'); | 373 await addTestSource('class C {foo(){var f; {var x;} new^ C();}}'); |
374 await assertTarget('new C();', '{var f; {var x;} new C();}'); | 374 await assertTarget('new C();', '{var f; {var x;} new C();}'); |
375 } | 375 } |
376 | 376 |
377 test_MapLiteralEntry() async { | 377 test_MapLiteralEntry() async { |
378 // MapLiteralEntry MapLiteral VariableDeclaration | 378 // MapLiteralEntry MapLiteral VariableDeclaration |
379 await addTestSource('foo = {^'); | 379 await addTestSource('foo = {^'); |
380 await assertTarget(' : ', '{ : }'); | 380 // fasta scanner inserts synthetic closing '}' |
| 381 await assertTarget('}', '{}'); |
381 } | 382 } |
382 | 383 |
383 test_MapLiteralEntry1() async { | 384 test_MapLiteralEntry1() async { |
384 // MapLiteralEntry MapLiteral VariableDeclaration | 385 // MapLiteralEntry MapLiteral VariableDeclaration |
385 await addTestSource('foo = {T^'); | 386 await addTestSource('foo = {T^'); |
386 await assertTarget('T : ', '{T : }'); | 387 await assertTarget('T : ', '{T : }'); |
387 } | 388 } |
388 | 389 |
389 test_MapLiteralEntry2() async { | 390 test_MapLiteralEntry2() async { |
390 // SimpleIdentifier MapLiteralEntry MapLiteral VariableDeclaration | 391 // SimpleIdentifier MapLiteralEntry MapLiteral VariableDeclaration |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 await addTestSource('main() {int b^ = 1;}'); | 593 await addTestSource('main() {int b^ = 1;}'); |
593 await assertTarget('b = 1', 'int b = 1'); | 594 await assertTarget('b = 1', 'int b = 1'); |
594 } | 595 } |
595 | 596 |
596 test_VariableDeclaration_lhs_identifier_before() async { | 597 test_VariableDeclaration_lhs_identifier_before() async { |
597 // VariableDeclaration VariableDeclarationList | 598 // VariableDeclaration VariableDeclarationList |
598 await addTestSource('main() {int ^b = 1;}'); | 599 await addTestSource('main() {int ^b = 1;}'); |
599 await assertTarget('b = 1', 'int b = 1'); | 600 await assertTarget('b = 1', 'int b = 1'); |
600 } | 601 } |
601 } | 602 } |
OLD | NEW |