Skip to content

LSP / Editor Integration

The Unfault CLI includes a full Language Server Protocol server. Start it with:

Terminal window
unfault lsp

It communicates over stdio, which is the standard transport for most LSP clients.

The LSP server runs the same local analysis pipeline as unfault review (Tree-sitter parsing, semantic graph construction, and rule analysis) and publishes diagnostics in real time as you work.

  • Diagnostics: Inline squiggles for findings (Error for critical/high, Warning for medium, Info for low)
  • Code actions: Quick-fix suggestions from structured patches or unified diffs
  • File centrality: Custom notification unfault/fileCentrality (how central the current file is in the dependency graph)
  • File dependencies: Custom notification unfault/fileDependencies (files that depend on the current one)
  • Hover: Function impact analysis using call graph traversal
local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')
if not configs.unfault then
configs.unfault = {
default_config = {
cmd = { 'unfault', 'lsp' },
filetypes = { 'python', 'go', 'rust', 'typescript', 'javascript' },
root_dir = lspconfig.util.root_pattern(
'pyproject.toml', 'Cargo.toml', 'go.mod', 'package.json'
),
},
}
end
lspconfig.unfault.setup {}

Create .vscode/settings.json with a custom LSP client extension, or use a generic LSP client extension that accepts a command. Point it at unfault lsp --stdio.

  • Python
  • Go
  • Rust
  • TypeScript / JavaScript

No diagnostics appearing

  1. Check the language server output: run unfault lsp --verbose manually and look for errors.
  2. Verify unfault is on your PATH and runs without errors.
  3. Check that your project root has a recognizable manifest file (pyproject.toml, Cargo.toml, go.mod, package.json, etc.).

Slow first analysis

The first run builds the full semantic graph for your project. Subsequent interactions use a cache.