This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Rename variable sometimes fails when using the LanguageServer #477
Closed
Description
@cipri-tom commented on Thu Dec 06 2018
Environment data
- VS Code version: 1.29.1
- Extension version (available under the Extensions sidebar): 2018.11.0
- OS and version: macOS Mojave 10.14.1
- Python version (& distribution if applicable, e.g. Anaconda): python 3.6.4 64-bit conda
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions:
- Microsoft Python Language Server version 0.1.60.0
Steps to reproduce:
- Make new file,
test.py
- paste the following:
def iadd_no_overflow(a, b):
"""Perform `a += b` on integer numpy arrays without overflowing"""
dest += src
dest[dest < src] = np.iinfo(dest.dtype).max
Note the file is dirty (not saved). The same happens if the file is saved.
- Place cursor on
dest
and hit F2 or chooseRename symbol
. Entera
as name.
Expected behaviour
All occurences of dest
are changed into a
Actual behaviour
Got a tooltip Cannot rename
, and an error in the Output window:
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.60.0
Initializing for /Users/ciprian/miniconda3/bin/python
[Error - 12:12:43 PM] Request textDocument/rename failed.
Message: Cannot rename
Code: -32000
at Microsoft.Python.LanguageServer.Implementation.Server.Rename(RenameParams params, CancellationToken cancellationToken)
at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Rename(JToken token, CancellationToken cancellationToken)
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
):
Nothing. I mean, there are some ERR
but from before. I put a console.log
and then reproduce the error and nothing new appears in the console.