https://github.com/smirnoffmg/litestar-vscode
Visual Studio Code extension for Litestar framework development. Route explorer with hierarchical view of routers, controllers and handlers. CodeLens for test client navigation. Diagnostics for common issues. Dependency injection visualization. Built on LSP with Python backend for accurate static analysis.
https://github.com/smirnoffmg/litestar-vscode
asgi language-server-protocol litestar python vscode-extension
Last synced: 4 months ago
JSON representation
Visual Studio Code extension for Litestar framework development. Route explorer with hierarchical view of routers, controllers and handlers. CodeLens for test client navigation. Diagnostics for common issues. Dependency injection visualization. Built on LSP with Python backend for accurate static analysis.
- Host: GitHub
- URL: https://github.com/smirnoffmg/litestar-vscode
- Owner: smirnoffmg
- License: other
- Created: 2026-02-27T06:56:15.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-27T11:37:26.000Z (4 months ago)
- Last Synced: 2026-02-27T14:26:18.366Z (4 months ago)
- Topics: asgi, language-server-protocol, litestar, python, vscode-extension
- Language: Python
- Homepage:
- Size: 974 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Support: SUPPORT.md
Awesome Lists containing this project
README
# Litestar extension for VS Code
VS Code extension that understands your [Litestar](https://litestar.dev/) app structure.
[](https://marketplace.visualstudio.com/items?itemName=smirnoffmg.litestar)
[](LICENSE)
## What it does
**Route Explorer** - see every route in your app as a tree: `app` -> `routers` -> `controllers` -> `handlers`. Click to jump to code.

**Route Search** - fuzzy-search routes by path, method, or handler name.

**CodeLens** - links above `client.get("/items")` calls in tests that take you to the matching handler.

**Diagnostics** - warns about missing return types, sync handlers without `sync_to_thread`, duplicate routes, bad guard signatures.
**DI & guard visualization** - hover a handler to see which dependencies are injected and which guards apply across all layers.
**Snippets** - `ls-get`, `ls-post`, `ls-controller`, `ls-router`, `ls-guard`, `ls-middleware`, `ls-test` and more.
## Install
Search "Litestar" in the VS Code extensions panel, or:
```bash
ext install smirnoffmg.litestar
```
Requires Python 3.9+ and the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python).
## Configuration
The extension auto-detects your app by finding `Litestar(...)` in the codebase. If that doesn't work, set the entry point manually:
```json
{
"litestar.entryPoint": "my_app.main:app"
}
```
Other settings: `litestar.codeLens.enabled`, `litestar.diagnostics.enabled`, `litestar.showNotification`, `litestar.interpreter`. See full list in the extension settings panel.
## How it works
TypeScript side talks to VS Code. Python side (built on [pygls](https://github.com/openlawlibrary/pygls)) parses your code with `ast`, discovers routes, resolves the dependency/guard hierarchy, and reports diagnostics. They communicate over LSP.
## Development
```bash
git clone https://github.com/smirnoffmg/litestar-vscode.git
cd litestar-vscode
python -m venv .venv && source .venv/bin/activate
pip install nox && nox --session setup
npm install
```
Press `F5` in VS Code to launch the extension in debug mode.
```bash
nox --session tests # run tests
nox --session lint # lint everything
nox --session build_package # build .vsix
```
## Contributing
PRs and issues welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).
## License
[MIT](LICENSE)
## Credits
Built on the [VS Code Python Tools Extension Template](https://github.com/microsoft/vscode-python-tools-extension-template). Powered by [pygls](https://github.com/openlawlibrary/pygls) and [Litestar](https://litestar.dev/).