Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating to 2021.3, "Goto definition", "Find all references", "Rename Symbol" work only after second attempt. #15740

Closed
grlscz opened this issue Mar 21, 2021 · 3 comments
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@grlscz
Copy link

grlscz commented Mar 21, 2021

  • VS Code version: 1.54.3
  • Extension version (available under the Extensions sidebar): 2021.3.658691958
  • OS and version: Windows_NT x64 6.1.7601
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.5 64-bit, Anaconda 3.8.3 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Value of the python.languageServer setting: Pylance

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

"Goto definition", "Find all references", "Rename Symbol" are expected to work every time

Actual behaviour

After first attempt to execute one of those commands, for "Goto definition" - "No definition found" message is displayed, for "Find all references" - "No results", for "Rename Symbol" - "No result".
The second time same command is attempted, it works as expected.

Downgrading to the previous version of the extension solved the problem.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

def test():
    for i in range(5):
        print(i)

test()
  1. "Goto definition" on the last "test()"
  2. "Find all references" on the first "test()"
  3. "Rename Symbol" on "i"

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonSendEntireLineToREPL'
User belongs to experiment group 'pythonNotDisplayLinterPrompt'
User belongs to experiment group 'pythonTensorboardExperimentcf'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'DeprecatePythonPath - control'
> conda --version
> pyenv root
> python3.7 c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.7 c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.6 c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3 c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -2 c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> C:\Program Files\Python36\python.exe c:\Users\v\.vscode\extensions\ms-python.python-2021.3.658691958\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Error 2021-03-21 13:19:02: Detection of Python Interpreter for Command py and args -3.7 failed as file  does not exist
Python interpreter path: C:\Program Files\Python36\python.exe
Starting Pylance language server.
> conda info --json
> conda info --json
> conda info --json
> conda env list
> conda info --json
> conda env list

@grlscz grlscz added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Mar 21, 2021
@zroadhouse
Copy link

zroadhouse commented Mar 21, 2021

Downgrading to the previous version of the extension solved the problem.

What version combination is working for you? I've tried downgrading to multiple different extension versions and it doesn't fix the issue.

EDIT: Updating ms-python.python to v2021.2.636928669 fixes the issue for me. Note that I am also using Pylance and that changing versions of Pylance did not fix the issue.

@Haibao425
Copy link

Same issue
#15727

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Mar 22, 2021
@karthiknadig karthiknadig added the area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. label Mar 22, 2021
@karthiknadig
Copy link
Member

Duplicate of #15727

@karthiknadig karthiknadig marked this as a duplicate of #15727 Mar 22, 2021
@ghost ghost removed the triage label Mar 22, 2021
@kimadeline kimadeline removed their assignment Mar 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

5 participants