vscode-wasi-pygls [](https://marketplace.visualstudio.com/items?itemName=swyddfa.pygls-wasi-playground)
November 8, 2024 ยท View on GitHub
Usage
It is possible to use this extension in a local version of VSCode however, its primary purpose is to demonstrate that it is possible to run a language server written with pygls entirely in the browser!
- Open https://vscode.dev/github/openlawlibrary/pygls, you will need to sign into GitHub before the repository's content will load.
- Install the
swyddfa.pygls-wasi-playgroundextension - By default, the extension will be configured to launch the
examples/servers/code_action.pyserver, though this can be changed by setting thepygls.server.launchScriptoption. - Open the
examples/servers/workspace/sums.txtfile - Wait for the server to boot up (will take 2-3min to load all the required resources over the network)
This extension is a WASI port of the pygls-playground extension from the upstream project, see the documentation for more details on its usage. Note that some features (like debugging!) have not yet been implemented.
Acknowledgements
This stands on the shoulders of a lot of excellent projects and resources, without which this would be impossible.
Projects
- openlawlibrary/pygls: For making it possible to write language servers in Python
- brettcannon/cpython-wasi-build: For providing the WASI build of CPython
- microsoft/vscode-wasm: For implementing the WASI host in VSCode as well as the following code snippets, showing how to connect everything up
Resources
- Testing a Python project using the WASI build of CPython with pytest: For showing how to build and use a Python environment with the WASI build of CPython
- VSCode and WebAssemblies