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

Don't display in_hierarchy options that are not relevant to the current refactoring operation#1143

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:lieryan-in-hierarchy
Jun 28, 2023

Conversation

lieryan
Copy link
Contributor

@lieryanlieryan commentedSep 28, 2021
edited
Loading

Currently, when doing a refactoring operation, python-mode often display this four options:

[Pymode] Choose what to do:1. perform2. preview3. perform in class hierarchy4. preview in class hierarchyType number and <Enter> or click with the mouse (q or empty cancels):

In many of the operations, 3 and 4 doesn't really do anything different than 1 and 2 and it's rather difficult to remember which operations you can actually do in_hierarchy with and which ones doesn't.

With this PR, we don't show these extraneous operations when they are not relevant for the current refactoring operation.

[Pymode] Choose what to do:1. perform2. previewType number and <Enter> or click with the mouse (q or empty cancels):

@diraol
Copy link
Contributor

Hi@lieryan sorry for thevery long time to review it.
Can you post here a sample code and instructions for us to test it?

@lieryan
Copy link
ContributorAuthor

Hi@diraol, thanks for looking into this. The changed behavior here does not actually depend on the text on the Vim buffer, so it shouldn't matter what the code you have on the python file for testing this change. In any case, in the places where I've removed the in-hierarchy option, currently python-mode never passes those options to rope anyway (for example).

If you want a code sample that demonstrates what the in_hierarchy does though, it basically changes how rope finds members of a class that belongs to a class inheritance hierarchy:

classFruit(abc.ABC):defeat(self):passclassApple(Fruit):defeat(self):passclassOrange(Fruit):defeat(self):pass

Whenin_hierarchy=True, when renamingOrange.eat(), bothFruit.eat(),Apple.eat(), are considered the "same" symbol, so they're renamed as well. Otherwise, whenin_hierarchy=False, only symbols that refers toOrange.eat() are renamed.

@diraol
Copy link
Contributor

👋🏽
Let's try to move with this one too!
This seems to be an easy conflict to handle.

@lieryan
Copy link
ContributorAuthor

Hi@diraol, thank you for looking into these PRs, I've updated this one against the latest develop and addressed the merge conflicts.

@diraoldiraol merged commitc86c4db intopython-mode:developJun 28, 2023
@lieryanlieryan deleted the lieryan-in-hierarchy branchJune 28, 2023 01:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@diraoldiraoldiraol approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@lieryan@diraol

[8]ページ先頭

©2009-2025 Movatter.jp