| 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.correction.assist; | 5 library test.services.correction.assist; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:analysis_server/src/services/correction/assist.dart'; | 8 import 'package:analysis_server/src/services/correction/assist.dart'; |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 void test_assignToLocalVariable_alreadyAssignment() { | 606 void test_assignToLocalVariable_alreadyAssignment() { |
| 607 resolveTestUnit(''' | 607 resolveTestUnit(''' |
| 608 main() { | 608 main() { |
| 609 var vvv; | 609 var vvv; |
| 610 vvv = 42; | 610 vvv = 42; |
| 611 } | 611 } |
| 612 '''); | 612 '''); |
| 613 assertNoAssistAt('vvv =', AssistKind.ASSIGN_TO_LOCAL_VARIABLE); | 613 assertNoAssistAt('vvv =', AssistKind.ASSIGN_TO_LOCAL_VARIABLE); |
| 614 } | 614 } |
| 615 | 615 |
| 616 void test_assignToLocalVariable_invocationArgument() { |
| 617 resolveTestUnit(r''' |
| 618 main() { |
| 619 f(12345); |
| 620 } |
| 621 int f(p) {} |
| 622 '''); |
| 623 assertNoAssistAt('345', AssistKind.ASSIGN_TO_LOCAL_VARIABLE); |
| 624 } |
| 625 |
| 616 void test_assignToLocalVariable_throw() { | 626 void test_assignToLocalVariable_throw() { |
| 617 resolveTestUnit(''' | 627 resolveTestUnit(''' |
| 618 main() { | 628 main() { |
| 619 throw 42; | 629 throw 42; |
| 620 } | 630 } |
| 621 '''); | 631 '''); |
| 622 assertNoAssistAt('throw ', AssistKind.ASSIGN_TO_LOCAL_VARIABLE); | 632 assertNoAssistAt('throw ', AssistKind.ASSIGN_TO_LOCAL_VARIABLE); |
| 623 } | 633 } |
| 624 | 634 |
| 625 void test_assignToLocalVariable_void() { | 635 void test_assignToLocalVariable_void() { |
| (...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2647 positions.add(new Position(testFile, offset)); | 2657 positions.add(new Position(testFile, offset)); |
| 2648 } | 2658 } |
| 2649 return positions; | 2659 return positions; |
| 2650 } | 2660 } |
| 2651 | 2661 |
| 2652 void _setStartEndSelection() { | 2662 void _setStartEndSelection() { |
| 2653 offset = findOffset('// start\n') + '// start\n'.length; | 2663 offset = findOffset('// start\n') + '// start\n'.length; |
| 2654 length = findOffset('// end') - offset; | 2664 length = findOffset('// end') - offset; |
| 2655 } | 2665 } |
| 2656 } | 2666 } |
| OLD | NEW |