Shared Python and TypeScript libraries for VS Code Python tool extensions (black-formatter, flake8, isort, mypy, pylint).
vscode-common-python-lsp/
├── python/ # Python package (bundled server-side)
│ ├── vscode_common_python_lsp/ # Package source
│ │ └── __init__.py
│ ├── tests/ # Python tests (pytest)
│ ├── pyproject.toml # Package metadata & build config
│ └── requirements-dev.txt # Dev/test dependencies
│
├── typescript/ # TypeScript package (VS Code client-side)
│ ├── src/ # Package source
│ │ └── index.ts
│ ├── tests/ # TypeScript tests (mocha)
│ ├── package.json
│ └── tsconfig.json
│
├── .github/ # CI/CD workflows
├── LICENSE
├── SECURITY.md
└── README.md
The vscode_common_python_lsp Python package provides server-side utilities shared
across all five extensions: path resolution, context managers, tool execution runners,
JSON-RPC process management, and the LSP server factory.
cd python
pip install -e ".[dev]"
pytest tests/The vscode-common-python-lsp TypeScript package provides VS Code client-side
utilities: extension activation, server lifecycle, settings management, Python
interpreter resolution, and logging.
cd typescript
npm install
npm run build
npm testGit submodule (current):
git submodule add https://github.com/microsoft/vscode-common-python-lsp.git submodules/vscode-common-python-lspPython side — install into bundled/libs/ via noxfile.
TypeScript side — file: dependency in package.json.
To restart the language server whenever packages are installed or removed,
an extension sets refreshExtensionOnPackagesChange: true on the ToolConfig it
passes in. The key defaults to false; when set to true, the shared activation logic
subscribes once to the package-change events reported by the
Python Environments extension
during initialization and restarts the server on each one. The automatic refresh
wiring is internal; the underlying IPythonApi.onDidChangePackages event remains
available for consumers that need it.
| Runtime | Minimum Version |
|---|---|
| Python | 3.10+ |
| Node.js | 18+ |
| VS Code | 1.74.0+ |
This project welcomes contributions and suggestions. See CONTRIBUTING.md for details.