Rename refactoring doesn't apply to the references of the renamed class
Rename refactoring is partially executed and doesn't rename all uses of the target class.
Steps to reproduce the behavior:
- Code before refactoring:
p1/A.py:
class A:
pass
p1/B.py:
from p1.A import A
class B(A):
pass
p2/C.py:
from p1.A import A
class C(A):
pass
-
Rename class A to C
-
Expected to Rope rename all references of the use of the refactored class.
This is kinda expected behavior, or rather undefined behavior. Rope currently assumes that you have a normal package, i.e. you need an __init__.py file for a package to be properly considered part of a package. If you have a package without __init__.py, rope doesn't automatically assume that the different .py files are related. It can sometimes be arbitrary whether Rope would treat another .py file as valid refactoring or not.
It would be good to have a more well defined behavior on how rope handles modules that aren't part of a normal package, but the easiest workaround right now is to make sure that you have __init__.py wherever that need to exists.