vscode-python: "Rename Symbol" often fails to rename when using Rope
Environment data
VS Code version: 1.18.0 Python Extension version: 0.8.0 Python Version: 3.5.3 Anaconda 4.0.0 OS and version: Widows 10 Professional
Actual behavior
“Symbol Rename” for a Python symbol fails to rename in about 50% of cases. The symbol remains as its old name and is not renamed
Expected behavior
Rename to rename symbols everytime.
Steps to reproduce:
- Select symbol (e.g. “node”), choose “Rename Symbol” from context menu
- Enter new symbol name (e.g. “node2”)
- Press Enter Symbol may not be renamed
Logs
Output from Python
output panel
No output
Output from ```Console window``` (Help->Developer Tools menu)
No output
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 36
- Comments: 38 (11 by maintainers)
It seems Python symbol refactoring has stopped working for me altogether! VS Code 1.33.0, macOS 10.14.4, Python 3.7.3, Python extension: 2019.3.6558
The “Rename symbol” command is made possible because of rope, right?
As far as I understand, rope does not support Python 3, although their pypi page says “Full python3 support is in progress… stay tuned”. Could it be that we are seeing issues with “Rename symbol” because of working with Python 3? This would explain why I am experiencing very slow renames or just failed ones, as I am pretty much only using Python 3.x.
This is my vscode version (as of writing this) and I’m working with a venv which is Python 3.6 or 3.7 with rope 0.11.0 pip-installed in the venvs:
Also getting this other times:
@calvin620707 correct, but the new language server has built-in support (at least in the beta channel as of version 0.2.53).
Did anywhere exist other extension support renaming variable of python code within vscode? I could not find one on the extensions panel.
I have the same problem.
If I use Rename Symbol, it works within the same file, but does not rename the symbol in the other files of the project / open folder. The only way I can make sure everything is renamed is to run a Search: Find in Files and manually rename all instances.
I’m on Code 1.26.0-insider + vscode-python 2018.6.0 (20 June 2018)
@singularitti we have no recommendation beyond the latest release.
We’re actively working to getting renaming working with our new language server which should replace our need to rely on Rope.
I’m on VSCode 1.22.2, Mac OS 10.13.4, Python 3.6, just installed rope fresh from pip. I get three different kinds of behavior from the following code (example). My problems seem to be related to the OP’s, but somehow a superset of symptoms…
Action: highlight one of the
y
and Rename Symbol toyy
.y
toyy
.z
toyy
, and in these cases,y
stays asy
!?!I’m not sure how to get any of the output logs I’ve seen on other threads.