Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc86c4db

Browse files
authored
Merge pull request#1143 from lieryan/lieryan-in-hierarchy
Don't display in_hierarchy options that are not relevant to the current refactoring operation
2 parents71a7f08 +2b047c2 commitc86c4db

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

‎pymode/rope.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,11 @@ def run(self):
463463
ifnotinput_str:
464464
returnFalse
465465

466+
code_actions=self.get_code_actions()
466467
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+
)
470471

471472
in_hierarchy=action.endswith("in class hierarchy")
472473

@@ -492,6 +493,12 @@ def run(self):
492493
exceptExceptionase:# noqa
493494
env.error('Unhandled exception in Pymode: %s'%e)
494495

496+
defget_code_actions(self):
497+
return [
498+
'perform',
499+
'preview',
500+
]
501+
495502
@staticmethod
496503
defget_refactor(ctx):
497504
""" Get refactor object. """
@@ -546,6 +553,14 @@ def get_input_str(self, refactor, ctx):
546553

547554
returnnewname
548555

556+
defget_code_actions(self):
557+
return [
558+
'perform',
559+
'preview',
560+
'perform in class hierarchy',
561+
'preview in class hierarchy',
562+
]
563+
549564
@staticmethod
550565
defget_changes(refactor,input_str,in_hierarchy=False):
551566
""" Get changes.
@@ -708,7 +723,7 @@ def get_changes(refactor, input_str, in_hierarchy=False):
708723
dest=ctx.project.pycore.find_module(input_str)
709724
else:
710725
dest=input_str
711-
returnsuper(MoveRefactoring,MoveRefactoring).get_changes(refactor,dest,in_hierarchy=in_hierarchy)
726+
returnsuper(MoveRefactoring,MoveRefactoring).get_changes(refactor,dest)
712727

713728

714729
classChangeSignatureRefactoring(Refactoring):
@@ -737,6 +752,14 @@ def get_refactor(ctx):
737752
returnchange_signature.ChangeSignature(
738753
ctx.project,ctx.resource,offset)
739754

755+
defget_code_actions(self):
756+
return [
757+
'perform',
758+
'preview',
759+
'perform in class hierarchy',
760+
'preview in class hierarchy',
761+
]
762+
740763
defget_changes(self,refactor,input_string,in_hierarchy=False):
741764
""" Function description.
742765

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp