@@ -505,14 +505,7 @@ def get_input_str(refactor, ctx):
505
505
506
506
@staticmethod
507
507
def get_changes (refactor , input_str , in_hierarchy = False ):
508
- """ Get changes.
509
-
510
- :return Changes:
511
-
512
- """
513
- progress = ProgressHandler ('Calculate changes ...' )
514
- return refactor .get_changes (
515
- input_str , task_handle = progress .handle , in_hierarchy = in_hierarchy )
508
+ raise NotImplementedError
516
509
517
510
518
511
class RenameRefactoring (Refactoring ):
@@ -550,8 +543,26 @@ def get_input_str(self, refactor, ctx):
550
543
551
544
return newname
552
545
546
+ @staticmethod
547
+ def get_changes (refactor , input_str , in_hierarchy ):
548
+ """ Get changes.
549
+
550
+ :return Changes:
551
+
552
+ """
553
+ return refactor .get_changes (input_str , in_hierarchy = in_hierarchy )
554
+
555
+ class ExtractRefactoring (Refactoring ):
556
+ @staticmethod
557
+ def get_changes (refactor , input_str , in_hierarchy ):
558
+ """ Get changes.
559
+
560
+ :return Changes:
561
+
562
+ """
563
+ return refactor .get_changes (input_str ) #, global_=not in_hierarchy)
553
564
554
- class ExtractMethodRefactoring (Refactoring ):
565
+ class ExtractMethodRefactoring (ExtractRefactoring ):
555
566
556
567
""" Extract method. """
557
568
@@ -574,18 +585,8 @@ def get_refactor(ctx):
574
585
return extract .ExtractMethod (
575
586
ctx .project , ctx .resource , offset1 , offset2 )
576
587
577
- @staticmethod
578
- def get_changes (refactor , input_str ):
579
- """ Get changes.
580
588
581
- :return Changes:
582
-
583
- """
584
-
585
- return refactor .get_changes (input_str )
586
-
587
-
588
- class ExtractVariableRefactoring (Refactoring ):
589
+ class ExtractVariableRefactoring (ExtractRefactoring ):
589
590
590
591
""" Extract variable. """
591
592
@@ -608,16 +609,6 @@ def get_refactor(ctx):
608
609
return extract .ExtractVariable (
609
610
ctx .project , ctx .resource , offset1 , offset2 )
610
611
611
- @staticmethod
612
- def get_changes (refactor , input_str ):
613
- """ Get changes.
614
-
615
- :return Changes:
616
-
617
- """
618
-
619
- return refactor .get_changes (input_str )
620
-
621
612
622
613
class InlineRefactoring (Refactoring ):
623
614
@@ -634,14 +625,13 @@ def get_refactor(ctx):
634
625
return inline .create_inline (ctx .project , ctx .resource , offset )
635
626
636
627
@staticmethod
637
- def get_changes (refactor , input_str ):
628
+ def get_changes (refactor , input_str , in_hierarchy ):
638
629
""" Get changes.
639
630
640
631
:return Changes:
641
632
642
633
"""
643
- progress = ProgressHandler ('Calculate changes ...' )
644
- return refactor .get_changes (task_handle = progress .handle )
634
+ return refactor .get_changes ()
645
635
646
636
647
637
class UseFunctionRefactoring (Refactoring ):
@@ -659,15 +649,13 @@ def get_refactor(ctx):
659
649
return usefunction .UseFunction (ctx .project , ctx .resource , offset )
660
650
661
651
@staticmethod
662
- def get_changes (refactor , input_str ):
652
+ def get_changes (refactor , input_str , in_hierarchy ):
663
653
""" Get changes.
664
654
665
655
:return Changes:
666
656
667
657
"""
668
- progress = ProgressHandler ('Calculate changes ...' )
669
- return refactor .get_changes (
670
- resources = [refactor .resource ], task_handle = progress .handle )
658
+ return refactor .get_changes ()
671
659
672
660
673
661
class ModuleToPackageRefactoring (Refactoring ):
@@ -684,7 +672,7 @@ def get_refactor(ctx):
684
672
return ModuleToPackage (ctx .project , ctx .resource )
685
673
686
674
@staticmethod
687
- def get_changes (refactor , input_str ):
675
+ def get_changes (refactor , input_str , in_hierarchy ):
688
676
""" Get changes.
689
677
690
678
:return Changes:
@@ -746,7 +734,7 @@ def get_refactor(ctx):
746
734
return change_signature .ChangeSignature (
747
735
ctx .project , ctx .resource , offset )
748
736
749
- def get_changes (self , refactor , input_string ):
737
+ def get_changes (self , refactor , input_string , in_hierarchy ):
750
738
""" Function description.
751
739
752
740
:return Rope.changes:
@@ -771,7 +759,7 @@ def get_changes(self, refactor, input_string):
771
759
changers .append (change_signature .ArgumentReorderer (
772
760
order , autodef = 'None' ))
773
761
774
- return refactor .get_changes (changers )
762
+ return refactor .get_changes (changers , in_hierarchy = in_hierarchy )
775
763
776
764
777
765
class GenerateElementRefactoring (Refactoring ):
0 commit comments