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

Pylance not enabling when using Remote Development #11

Closed
cfculhane opened this issue Jul 1, 2020 · 13 comments
Closed

Pylance not enabling when using Remote Development #11

cfculhane opened this issue Jul 1, 2020 · 13 comments
Labels
bug Something isn't working

Comments

@cfculhane
Copy link

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.
@pferreir
Copy link

pferreir commented Jul 1, 2020

Same here!

@jakebailey
Copy link
Member

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.

@erinxocon
Copy link

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

@jakebailey
Copy link
Member

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?

@pferreir
Copy link

pferreir commented Jul 1, 2020

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

@jakebailey
Copy link
Member

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
Copy link

erinxocon commented Jul 1, 2020

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

@Destaq
Copy link

Destaq commented Jul 2, 2020

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

@huguesv
Copy link
Contributor

huguesv commented Jul 2, 2020

@Destaq Your json is correct and should work despite this expected schema validation error. #16 (comment)

@cfculhane
Copy link
Author

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

@judej
Copy link
Contributor

judej commented Aug 6, 2020

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

@judej judej closed this as completed Aug 6, 2020
@quaesitor-scientiam
Copy link

This worked for me as well.

@GF-Huang
Copy link

Not work, all software and extensions latest version.

image

image

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

No branches or pull requests

10 participants