PTVS
PTVS copied to clipboard
Refactor rename incorrect when the referenced method is defined in another project.
Describe the bug
Steps to Reproduce
- Create python application named PythonAppication1
- Create python application named PythonAppication2
- Right-click in PythonAppication1 and select Add->reference..., select PythonApplication2 as referenced
- Typing code in PythonApplication2.py
def add(a, b):
print(a + b)
- Typing code in PythonAppication1.py
import PythonApplication2
PythonApplication2.add(1,2)
- Open PythonApplication2.py and select function name add and right-click to select rename...
- Input a new name addTest in rename dialog and press enter
Expected behavior
The name add can be renamed as addTest both in PythonApplication2.py and PythonApplication1.py
Actual behavior
Nothing has changed.
Very weird. Only repros with the cross project reference. Otherwise rename works fine.
In today's build 17.1.0 Preview 3.0 [32030.14.main]
, The name of the place where this method is called has not changed.
In today's build 17.2.0 Preview 2.0 [32228.339.main].In the same project, rename a method, but the method name of this method in other places where it is called has not changed
The original bug is reported for two projects, with one referencing the other. But the latest screenshots show this is broken for two files in the SAME project. We need to investigate and fix both of these cases if they still repro.
@ttSpace Can you please verify if this is still happening on the latest version of Visual Studio? For both single project and multiproject cases. Thank you!
@AdamYoblick In today's build 17.6.0 Preview 2.0 [33406.287.main]
, Python Package: 17.0.23033.1
, In two Projects, Renamed only in PythonApplication2.py. The name of the place where this method is called has not changed. foo --> footest
This works fine for the two files in the SAME project. foo --> footest
In today's latest build:17.7.0 Preview 2.0 [33709.378.main],Python package:17.0.23115.2
In two Projects, the 'rename' command doesn't have any responce after selecting it
@linette-zyy I was trying to repro this issue, how did you find the other project to add as reference? Mine shows nothing was found.
This issue was closed because it has been stalled for 30 days with no activity. If the issue still persists, please reopen with the information requested. Thanks.