diffguard-lsp
Language Server Protocol (LSP) server for diffguard.
Features
- Handles
initialize,shutdown, andexitover stdio (lsp-server) - Publishes
textDocument/publishDiagnosticsfindings fromdiffguard-core - Uses diff-scoped evaluation:
- In-memory changed lines while editing
git diffscoped lines when the buffer is clean
- Loads
diffguard.toml(supports includes and${VAR}/${VAR:-default}expansion) - Applies per-directory
.diffguard.tomloverrides - Provides code actions:
diffguard: Explain <rule-id>diffguard: Open docs for <rule-id>(when rule URL exists)
- Supports execute commands:
diffguard.explainRulediffguard.reloadConfigdiffguard.showRuleUrl
Run
The server is intended to be started by an editor client over stdio.
Initialization Options
initializationOptions (all optional):
configPath(string): explicit config pathnoDefaultRules(bool): disable built-in rulesmaxFindings(number): cap findings per diagnostic passforceLanguage(string): force preprocessing language