8000 Refactor extract get_code_actions() · python-mode/python-mode@6c51814 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c51814

8000 Browse files
committed
Refactor extract get_code_actions()
1 parent 4bc4581 commit 6c51814

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

pymode/rope.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,11 @@ def run(self):
463463
if not input_str:
464464
return False
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,14 @@ def run(self):
492493
except Exception as e: # noqa
493494
env.error('Unhandled exception in Pymode: %s' % e)
494495

496+
def get_code_actions(self):
497+
return [
498+
'perform',
499+
'preview',
500+
'perform in class hierarchy',
501+
'preview in class hierarchy',
502+
]
503+
495504
@staticmethod
496505
def get_refactor(ctx):
497506
""" Get refactor object. """

0 commit comments

Comments
 (0)
0