VS Code Extension
The Unfault VS Code extension shows you what your code means at runtime - where functions are called from, which routes they affect, and what safeguards exist in the call chain.
Installation
Section titled “Installation”- Open VS Code
- Press
Cmd+Shift+X(macOS) orCtrl+Shift+X(Windows/Linux) - Search for “Unfault”
- Click Install
The extension requires the Unfault CLI. If you haven’t installed it yet, follow the steps in /docs/installation, then authenticate:
unfault loginWhat You’ll See
Section titled “What You’ll See”Code Lenses
Section titled “Code Lenses”Above each function, a code lens shows its runtime context:
uf: used by 3 places · reached by POST /api/checkout · worth a lookClick to open the Context sidebar with full details.
Context Sidebar
Section titled “Context Sidebar”The sidebar (in Explorer) shows:
- Callers: Where this function is called from
- Routes: Which HTTP routes reach this function
- SLOs: Service level objectives linked to those routes
- Heads up (
worth a look): Findings about the current function body (things to fix here) - Upstream: Issues in code that calls into this function (things that can break you)
- Downstream: Issues in code you call from this function (things you rely on / can propagate)
The sidebar follows your cursor by default. Pin it to keep focus on a specific function.
File Centrality
Section titled “File Centrality”The status bar shows how central the current file is:
- Hub icon: Many files depend on this one
- Star icon: Moderately central
- (no extra icon): Regular file
Click Show Files That Depend on This File (or use the Unfault menu) to see exactly what depends on the current file.
Configuration
Section titled “Configuration”| Setting | Description | Default |
|---|---|---|
unfault.executablePath | Path to CLI | unfault |
unfault.fault.executablePath | Path to fault CLI | fault |
unfault.fault.baseUrl | Base URL of the app under test | http://127.0.0.1:8000 |
unfault.codeLens.enabled | Show code lenses above functions | true |
unfault.codeLens.clickToOpen | Click lens to open context sidebar | true |
unfault.diagnostics.enabled | Show inline squiggles (calm mode off) | false |
unfault.diagnostics.minSeverity | Minimum severity | high |
unfault.trace.server | LSP trace level | off |
unfault.verbose | Verbose logging | false |
Commands
Section titled “Commands”Access via Command Palette (Cmd+Shift+P) or click the status bar:
| Command | Description |
|---|---|
| Open Context Sidebar | Open Unfault: Context in the Explorer sidebar |
| Run fault injection for current function | Open the fault injection panel for the current function |
| Generate fault scenarios for current function | Generate per-route scenario suites under tests/fault/ or test/fault/ |
| Show Files That Depend on This File | List files that import this one |
| Show Unfault Output | View LSP logs for debugging |
| Open Unfault Settings | Jump to Unfault settings |
| Show Unfault Menu | Quick pick with all actions |
| Welcome & Setup | Welcome panel + auth help |
| Restart Unfault LSP Server | Restart the language server |
Fault Injection
Section titled “Fault Injection”The Context sidebar includes a Fault Injection panel.
- If
faultisn’t installed, the extension offers to rununfault addon install faultfor you. - Clicking Run starts
fault runand opens a split terminal with acurlcommand targeting the proxy. - Clicking Generate scenario file creates a repeatable scenario suite for the current route.
See /docs/guides/fault for details.
Supported Languages
Section titled “Supported Languages”- Python
- Go
- Rust
- TypeScript
- JavaScript
Troubleshooting
Section titled “Troubleshooting”No code lenses appearing
- Check that you’re in a supported file
- Run
unfault loginin the terminal - Run Unfault: Restart Server
- Check Output for errors
Extension slow on first open
The first analysis builds a semantic graph of your codebase. Subsequent interactions use the cache.
CLI not found
Set unfault.executablePath in settings to the full path to the unfault binary.
Learn More
Section titled “Learn More”For a detailed walkthrough of all features, see the VS Code Extension Tutorial.