@@ -463,10 +463,11 @@ def run(self):
463
463
if not input_str :
464
464
return False
465
465
466
+ code_actions = self .get_code_actions ()
466
467
action = env .user_input_choices (
467
- 'Choose what to do:' , 'perform' , 'preview' ,
468
- 'perform in class hierarchy' ,
469
- 'preview in class hierarchy' )
468
+ 'Choose what to do:' ,
469
+ * code_actions ,
470
+ )
470
471
471
472
in_hierarchy = action .endswith ("in class hierarchy" )
472
473
@@ -492,6 +493,12 @@ def run(self):
492
493
except Exception as e : # noqa
493
494
env .error ('Unhandled exception in Pymode: %s' % e )
494
495
496
+ def get_code_actions (self ):
497
+ return [
498
+ 'perform' ,
499
+ 'preview' ,
500
+ ]
501
+
495
502
@staticmethod
496
503
def get_refactor (ctx ):
497
504
""" Get refactor object. """
@@ -546,6 +553,14 @@ def get_input_str(self, refacto
10000
r, ctx):
546
553
547
554
return newname
548
555
556
+ def get_code_actions (self ):
557
+ return [
558
+ 'perform' ,
559
+ 'preview' ,
560
+ 'perform in class hierarchy' ,
561
+ 'preview in class hierarchy' ,
562
+ ]
563
+
549
564
@staticmethod
550
565
def get_changes (refactor , input_str , in_hierarchy = False ):
551
566
""" Get changes.
@@ -708,7 +723,7 @@ def get_changes(refactor, input_str, in_hierarchy=False):
708
723
dest = ctx .project .pycore .find_module (input_str )
709
724
else :
710
725
dest = input_str
711
- return super (MoveRefactoring , MoveRefactoring ).get_changes (refactor , dest , in_hierarchy = in_hierarchy )
726
+ return super (MoveRefactoring , MoveRefactoring ).get_changes (refactor , dest )
712
727
713
728
714
729
class ChangeSignatureRefactoring (Refactoring ):
@@ -737,6 +752,14 @@ def get_refactor(ctx):
737
752
return change_signature .ChangeSignature (
738
753
ctx .project , ctx .resource , offset )
739
754
755
+ def get_code_actions (self ):
756
+ return [
757
+ 'perform' ,
758
+ 'preview' ,
759
+ 'perform in class hierarchy' ,
760
+ 'preview in class hierarchy' ,
761
+ ]
762
+
740
763
def get_changes (self , refactor , input_string , in_hierarchy = False ):
741
764
""" Function description.
742
765
0 commit comments