Skip to content
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
brettcannon opened this issue Dec 10, 2018 · 1 comment
Closed

Rename variable sometimes fails when using the LanguageServer #477

brettcannon opened this issue Dec 10, 2018 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@brettcannon
Copy link
Member

@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:

  1. Make new file, test.py
  2. 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.

  1. Place cursor on dest and hit F2 or choose Rename symbol. Enter a 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 (ViewOutput, 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants