Test language servers with Python 2.7
See original GitHub issueRefs: https://github.com/microsoft/vscode-python/issues/17225
- macOS @misolori
- windows @brettcannon
- linux @brettcannon
Complexity: 3
Requirements
- You will need Python 2.7.16. Options are:
- You can install it from python.org
- On Mac/Linux, you can install it using your local package manager
- For a managed solution that will allow you to install multiple versions of Python you can use
pyenv
on Mac/Linux, orpyenv-win
on Windows, and callpyenv install 2.7.16
- Install
virtualenv
with python 2.7:path/to/python2 -m pip install virtualenv
- Make sure you have
"python.experiments.optInto": ["All"],
in your user settings. If not, add it and reload VS Code. - Make sure the
python.defaultInterpreterPath
entries in your user and workspace settings are at their default valuepython
- Use the latests Insiders build of the Python extension (set
python.insidersChannel
todaily
, wait for the download and installation to happen and reload VS Code)
Scenario 1: Jedi
- Create a folder with a Python file, and add the following
.vscode/settings.json
:
{
"python.languageServer": "Jedi"
}
- Create a Python 2.7 virtual environment in that folder:
/path/to/python2 -m virtualenv .venv
- Open the folder in VS Code, wait for the extension to load and the virtual environment to get auto-selected
- In the Python output panel, verify that
Editor support is inactive since language server is set to None.
is printed, and that language server capabilities are disabled
Scenario 2: Default
- Create a folder with a Python file, and add the following
.vscode/settings.json
:
{
"python.languageServer": "Default"
}
- Create a Python 2.7 virtual environment in that folder:
/path/to/python2 -m virtualenv .venv
- Open the folder in VS Code, wait for the extension to load and the virtual environment to get auto-selected
- In the Python output panel, verify that
Starting Pylance language server.
is printed, and that language server capabilities are working
Scenario 3: Pylance
- Create a folder with a Python file, and add the following
.vscode/settings.json
:
{
"python.languageServer": "Pylance"
}
- Create a Python 2.7 virtual environment in that folder:
/path/to/python2 -m virtualenv .venv
- Open the folder in VS Code, wait for the extension to load and the virtual environment to get auto-selected
- In the Python output panel, verify that
Starting Pylance language server.
is printed, and that language server capabilities are working
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
python-language-server - PyPI
python-language-server 0.36.2 ... A Python 2.7 and 3.5+ implementation of the Language Server Protocol. ... To run the test suite: pip install ....
Read more >Python LSP Server - GitHub
The base language server requires Jedi to provide Completions, Definitions, Hover, References, Signature Help, and Symbols: pip install python-lsp-server.
Read more >Python in Visual Studio Code – September 2021 Release
A rich Python editing experience in the browser; Revamped testing ... Python Language Server's end of life, as well as for Python 2.7...
Read more >How do you set up a local testing server? - MDN Web Docs
Running a simple local HTTP server · Go to python.org · Under the Download section, click the link for Python "3. · At...
Read more >Settings Reference for Python - Visual Studio Code
For example, for the arguments --a --b --c {"value1" : 1, "value2" : 2} , the list items should be ... The language...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I do not have Python setup on my Linux, thus I have swapped platform assignments with @mjbvz . I hope that is fine.
@mjbvz I took you off as I accidentally verified under Linux out of habit from launching VS Code under WSL. 😄 I also went ahead and verified under Windows as well.