Don't display in_hierarchy options that are not relevant to the current refactoring operation#1143
Conversation
|
Hi @lieryan sorry for the very long time to review it. |
|
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: class Fruit(abc.ABC):
def eat(self):
pass
class Apple(Fruit):
def eat(self):
pass
class Orange(Fruit):
def eat(self):
passWhen |
|
👋🏽 |
|
Hi @diraol, thank you for looking into these PRs, I've updated this one against the latest develop and addressed the merge conflicts. |
Currently, when doing a refactoring operation, python-mode often display this four options:
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.