Bubble for Zed
See exception flow through your Python codebase directly in Zed.
What it does
Hover over Python code to see exception information:
deflines: Shows all exceptions that can escape from the function (uncaught, framework-handled, caught locally, caught by global handler)- Function calls: Shows what exceptions the callee can throw
- Everything else: No popup (no noise)
Requirements
Install bubble-analysis with LSP support in your project's Python environment:
pip install bubble-analysis[lsp]The extension finds python3 on your PATH and runs python -m bubble.lsp.
Configuration
Override the Python binary or arguments in your Zed settings (settings.json):
{
"lsp": {
"bubble-lsp": {
"binary": {
"path": "/path/to/your/venv/bin/python",
"arguments": ["-m", "bubble.lsp"]
}
}
}
}How it works
The extension spawns a Python LSP server that:
- Builds a program model of your codebase on first hover
- Propagates exceptions through the call graph (cached after first run)
- Returns context-sensitive hover info based on cursor position
The model rebuilds automatically when you save a file.
Supported frameworks
Exception flow analysis supports Flask, FastAPI, and CLI scripts. Framework-specific exceptions (like HTTPException) are recognized and categorized appropriately.
Publishing updates
This repo is registered as a submodule in zed-extensions under extensions/bubble. A canonical copy also lives in the main bubble-analysis repo at editors/zed/.
To publish a new version:
- Make changes here and push to
main. - In your fork of
zed-extensions, update the submodule pointer:cd extensions/bubble git pull origin main cd ../.. - Bump the version in
extension.tomlhere and inextensions.tomlin zed-extensions (under[bubble-lsp]). - Commit the submodule update and version bump, then open a PR against
zed-industries/extensions. - Sync any changes back to
editors/zed/in the bubble-analysis repo to keep the two copies in lockstep.