Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 943053005: Don't propose 'Assign to local variable' when in arguments list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698