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

Fix Global and Module MoveRefactoring#1141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
diraol merged 3 commits intopython-mode:developfromlieryan:fix-move-refactoring
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletiondoc/pymode.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -613,14 +613,31 @@ code to call it instead.
let g:pymode_rope_use_function_bind = '<C-c>ru'


Movemethod/fields ~
Moverefactoring ~
*pymode-rope-move*

Moving method/fields

It happens when you perform move refactoring on a method of a class. In this
refactoring, a method of a class is moved to the class of one of its
attributes. The old method will call the new method. If you want to change all
of the occurrences of the old method to use the new method you can inline it
afterwards.

Moving global variable/class/function into another module

It happens when you perform move refactoring on global variable/class/function.
In this refactoring, the object being refactored will be moved to a destination
module. All references to the object being moved will be updated to point to
the new location.

Moving module variable/class/function into a package

It happens when you perform move refactoring on a name referencing a module.
In this refactoring, the module being refactored will be moved to a destination
package. All references to the object being moved will be updated to point to
the new location.

>
let g:pymode_rope_move_bind = '<C-c>rv'

Expand Down
9 changes: 9 additions & 0 deletionspymode/rope.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -701,6 +701,15 @@ def get_refactor(ctx):
offset = None
return move.create_move(ctx.project, ctx.resource, offset)

@staticmethod
def get_changes(refactor, input_str, in_hierarchy=False):
with RopeContext() as ctx:
if isinstance(refactor, (move.MoveGlobal, move.MoveModule)):
dest = ctx.project.pycore.find_module(input_str)
else:
dest = input_str
return super(MoveRefactoring, MoveRefactoring).get_changes(refactor, dest, in_hierarchy=in_hierarchy)


class ChangeSignatureRefactoring(Refactoring):

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp