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

Side by Side Diff: pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart

Issue 1786013004: Start using the new index in Analysis Server. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
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.refactoring.rename_class_member; 5 library test.services.refactoring.rename_class_member;
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; 7 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:analysis_server/src/services/correction/status.dart'; 8 import 'package:analysis_server/src/services/correction/status.dart';
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; 9 import 'package:test_reflective_loader/test_reflective_loader.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 } 565 }
566 class B extends A { 566 class B extends A {
567 test() {} // marker 567 test() {} // marker
568 } 568 }
569 class C extends B { 569 class C extends B {
570 test() {} 570 test() {}
571 } 571 }
572 class D implements A { 572 class D implements A {
573 test() {} 573 test() {}
574 } 574 }
575 class E {
Brian Wilkerson 2016/03/11 21:50:16 Not sure why this was removed. I assume it's origi
scheglov 2016/03/11 22:02:50 Thank you for catching this. It should have been r
576 test() {}
577 }
578 main() { 575 main() {
579 A a = new A(); 576 A a = new A();
580 B b = new B(); 577 B b = new B();
581 C c = new C(); 578 C c = new C();
582 D d = new D(); 579 D d = new D();
583 E e = new E();
584 a.test(); 580 a.test();
585 b.test(); 581 b.test();
586 c.test(); 582 c.test();
587 d.test(); 583 d.test();
588 e.test();
589 } 584 }
590 '''); 585 ''');
591 // configure refactoring 586 // configure refactoring
592 createRenameRefactoringAtString('test() {} // marker'); 587 createRenameRefactoringAtString('test() {} // marker');
593 expect(refactoring.refactoringName, 'Rename Method'); 588 expect(refactoring.refactoringName, 'Rename Method');
594 expect(refactoring.elementKindName, 'method'); 589 expect(refactoring.elementKindName, 'method');
595 expect(refactoring.oldName, 'test'); 590 expect(refactoring.oldName, 'test');
596 refactoring.newName = 'newName'; 591 refactoring.newName = 'newName';
597 // validate change 592 // validate change
598 return assertSuccessfulRefactoring(''' 593 return assertSuccessfulRefactoring('''
599 class A { 594 class A {
600 newName() {} 595 newName() {}
601 } 596 }
602 class B extends A { 597 class B extends A {
603 newName() {} // marker 598 newName() {} // marker
604 } 599 }
605 class C extends B { 600 class C extends B {
606 newName() {} 601 newName() {}
607 } 602 }
608 class D implements A { 603 class D implements A {
609 newName() {} 604 newName() {}
610 } 605 }
611 class E {
612 test() {}
613 }
614 main() { 606 main() {
615 A a = new A(); 607 A a = new A();
616 B b = new B(); 608 B b = new B();
617 C c = new C(); 609 C c = new C();
618 D d = new D(); 610 D d = new D();
619 E e = new E();
620 a.newName(); 611 a.newName();
621 b.newName(); 612 b.newName();
622 c.newName(); 613 c.newName();
623 d.newName(); 614 d.newName();
624 e.test();
625 } 615 }
626 '''); 616 ''');
627 } 617 }
628 618
629 test_createChange_MethodElement_potential() async { 619 test_createChange_MethodElement_potential() async {
630 indexTestUnit(''' 620 indexTestUnit('''
631 class A { 621 class A {
632 test() {} 622 test() {}
633 } 623 }
634 main(var a) { 624 main(var a) {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 // validate change 846 // validate change
857 return assertSuccessfulRefactoring(''' 847 return assertSuccessfulRefactoring('''
858 class A<NewName> { 848 class A<NewName> {
859 NewName field; 849 NewName field;
860 List<NewName> items; 850 List<NewName> items;
861 NewName method(NewName p) => null; 851 NewName method(NewName p) => null;
862 } 852 }
863 '''); 853 ''');
864 } 854 }
865 } 855 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698