Pylance-release: Pylance not enabling when using Remote Development

Created on 1 Jul 2020  路  11Comments  路  Source: microsoft/pylance-release

Environment data

  • Language Server version: v2020.6.1
  • OS and version:
    Version: 1.47.0-insider (user setup)
    Commit: b16b467d3e03e1a1ae05b5836e4e5a5af504e86d
    Date: 2020-07-01T05:32:07.483Z
    Electron: 7.3.2
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    V8: 7.8.279.23-electron.0
    OS: Windows_NT x64 10.0.19041
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.9 64, on virtualenv

Running through Remote Development via SSH

Expected behaviour

  • Install extension
  • Activate extension
  • Happy days

Actual behaviour

  • After installing extension and reloading the session, the dialog box to make Pylance the default language server is shown
  • When clicking "Yes, and reload" , after reloading the same dialog is shown. This is repeated despite clicking Yes and reloading many times

image

Logs

User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'AA_testing - experiment'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'DeprecatePythonPath - control'
User belongs to experiment group 'RunByLine - control'
User belongs to experiment group 'CustomEditorSupport - control'
> conda --version
> conda info --json
> pyenv root
> python3.7 ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Starting Microsoft Python language server.
Python interpreter path: ~/.virtualenvs/affinda/bin/python
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py jupyter kernelspec --version
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel"
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text /mnt/affinda/PROJECT_NAME/document.py
cwd: /mnt/affinda/PROJECT_NAME/django
> ~/.virtualenvs/affinda/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2020.7.91574-dev/pythonFiles/pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text /mnt/affinda/PROJECT_NAME/document.py
cwd: /mnt/affinda/PROJECT_NAME/django
> conda --version
##########Linting Output - pylint##########

... linting results

------------------------------------------------------------------
Your code has been rated at 7.58/10 (previous run: 7.58/10, +0.00)


Code Snippet / Additional information

  • Note that Pylance works fine on a local workspace on the same install.
bug

Most helpful comment

As a workaround, you should be able to edit the remote machine's settings and add:

"python.languageServer": "Pylance"

This is moderately related to #16, as we are currently only supporting the extension's prompt to change the setting in this preview.

All 11 comments

Same here!

As a workaround, you should be able to edit the remote machine's settings and add:

"python.languageServer": "Pylance"

This is moderately related to #16, as we are currently only supporting the extension's prompt to change the setting in this preview.

Related to ssh remove dev environments; this same thing happens inside of devcontainers and in wsl!

Interesting, we tested this within WSL and it appeared to operate correctly. This setting is declared in VS Code in such a way that it should be getting propagated to the remote host.

I see that the original report was an insiders build of VS Code, is that what you are using @pferreir @erinxocon or just the regular stable build?

@jakebailey I'm using the stable build on macOS. The remote server is Linux.

Ah, oops, I should have just mentioned @erinxocon, since they talk about WSL. I believe devcontainers and SSH operate through similar means (but WSL is different and one I know we tested).

@erinxocon I am using an insiders build. Setting Pylance manually makes the prompt go away and it does initialize in wsl and dev environments alike. Also probably related to #16, I'm not getting autocomplete for the pylance config options.

I see that Pylance uses most of the python config options already available! Grand!

As a workaround, you should be able to edit the remote machine's settings and add:

"python.languageServer": "Pylance"

This is moderately related to #16, as we are currently only supporting the extension's prompt to change the setting in this preview.

@jakebailey When setting that I get an issue from the settings.json saying that this is not a valid language server.

image

@Destaq Your json is correct and should work despite this expected schema validation error. https://github.com/microsoft/pylance-release/issues/16#issuecomment-652479956

Thanks, setting Pylance manually does work, with the 'value is not accepted' warning popping up, which I assume will be fixed soon.

The prompt issue should be fixed in 2020.8.0. If you are having remote issues, please file another issue.

Was this page helpful?
0 / 5 - 0 ratings