- .NET Core 3.1 SDK
- C# Extension to VS Code (all platforms)
- Python 2.7
- Python 3.6+
Alternative: Visual Studio 2019 (Windows only) with .NET Core and C# Workloads. Community Edition is free and is fully functional.
git clone https://github.com/Microsoft/python-language-server.git
cd src/LanguageServer/Impl
dotnet build
Visual Studio:
- Open the
PLS.sln
solution insrc
. - Build Microsoft.Python.LanguageServer project.
- Binaries arrive in
output/bin
. - Clone Python Extension to VS Code source: https://github.com/Microsoft/vscode-python
- Open Python extension sources folder in VS Code
- Create
languageServer
folder in the extension sources folder. - Copy everything from
output/bin/Debug
tolanguageServer
. - In VS Code set setting
python.downloadLanguageServer
tofalse
. - In VS Code set setting
python.jediEnabled
tofalse
.
Follow regular TypeScript debugging steps
- Launch another instance of VS Code
- Open
src
folder - In primary VS Code instance launch Python extension (F5)
- In the instance with Microsoft Python Language Server C# code select Dotnet Attach launch task.
- Attach to
dotnet
process runningMicrosoft.Python.languageServer.dll
On Windows you can also attach from Visual Studio (Debug | Attach To Process).
- Build C# code
- Copy binaries to
languageServer
folder - Use the Launch Extension launch option.
To run unit tests, do one of the following:
- Run the Unit Tests in the VS Code Python Extension project via Launch Language Server Tests.
- On Windows: open the
PLS.sln
solution in Visual Studio 2019 and run tests from the Test Explorer. - Run
dotnet test
from Terminal in thesrc
directory, or in a specific directory likesrc/Analysis/Ast/Test
to test a specific suite. - Install C# extension and .NET Core Test Explorer for VS Code, open src folder in VS Code and run tests.
NOTE: Language Server does not automatically discover Python installations on various operating systems. At run time path to the Python interpreter is provided by the client application. Test environment does make an attempt to discover Python installation, but in case it is unable to find Python you will not be able to run tests.
Import Formatting.vssettings
into Visual Studio or use .editorconfig
.