- .NET Core 2.1 SDK
- C# Extension to VS Code (all platforms)
- Python 2.7
- Python 3.6
Alternative: Visual Studio 2017 (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 buildVisual Studio 2017:
- Open PLS.sln solution in src
- 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 to languageServer
- In VS Code set setting python.downloadLanguageServer to false
- In VS Code set setting python.jediEnabled to false
Folow 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 running Microsoft.Python.languageServer.dll
On Windows you can also attach from Visual Studio 2017 (Debug | Attach To Process).
- Build C# code
- Copy binaries to languageServer folder
- Use the
Launch Extensionlaunch option.
To run unit tests, do one of the following:
- Run the Unit Tests in the VS Code Python Extension project via the
Launch Language Server Tests. - On Windows: open PLS.sln solution in Visual Studio 2017 and run tests from the Test Explorer.
- Run
dotnet testfrom Terminal in thesrcdirectory or fromsrc/Analysis/Engine/Testif you prefer not to see messages about projects that do not contain test code. - 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. Refer to the Python interpreter discovery code for Windows and *nix
Import Formatting.vssettings into Visual Studio or use .editorconfig.