Rename refactoring doesn't apply to the references of the renamed class

Offen
#700 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 7 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
devtools

Rechercherichtung

Reproduce with the three files in the report: p1/A.py defines class A, p1/B.py and p2/C.py import and subclass it. Run rope's rename on A and check whether the import and base-class references in B.py and C.py are updated. The payload does not name the rope modules involved, so locate the rename code by searching the repository. Done means every reference to the renamed class is rewritten; note that the report renames A to C, which collides with the existing class C.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug rename-refactor

Rename refactoring is partially executed and doesn't rename all uses of the target class.

Steps to reproduce the behavior:

  1. 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

  1. Rename class A to C

  2. Expected to Rope rename all references of the use of the refactored class.

Vorherrschende Sprache
Python
Sterne
2.2k
Forks
197
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
5

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python-rope/rope

Alle Issues in python-rope/rope

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.