LSP - Real-Time Code Diagnostics
The lsp module runs language servers (pyright, gopls,
typescript-language-server, ruff, ...) and exposes diagnostics to
the agent, plus a third tool for the special case of an agent
editing a Digitorn app's own source: lsp.diagnostics,
lsp.notify_change, and lsp.reload_app.
Agents can call these tools when the module is granted. Hooks
such as lsp_diagnose can also call them after edits.
Module declaration
tools:
modules:
lsp:
config:
# Optional overrides. Empty config uses built-in probes.
settle_seconds: 10
# servers:
# pyright:
# command: "pyright-langserver --stdio"
# extensions: [".py"]
Tools
| Action | Purpose |
|---|---|
lsp.diagnostics | Return current diagnostics for a file. |
lsp.notify_change | Report that a file changed (optional new content) and return diagnostics. |
lsp.reload_app | Recompile the session's own app from disk and make it live - for an agent that's editing a Digitorn app's own YAML/source, not general-purpose code editing. Refuses if the bundle still has compile errors. |
No short PascalCase alias - the LLM sees these under their full
lsp.diagnostics / lsp.notify_change / lsp.reload_app names.
Typical diagnostics response shape
{
"success": true,
"data": {
"diagnostics": [
{
"severity": "error",
"line": 42,
"column": 12,
"message": "Import 'foo' could not be resolved"
}
]
}
}
Exact fields depend on the language server / fallback parser.
Built-in language probes
When no custom servers map is set, the module probes common
binaries (examples):
| Language | Typical command |
|---|---|
| Python | pyright-langserver --stdio |
| TypeScript / JS | typescript-language-server --stdio |
| Go | gopls |
| Rust | rust-analyzer |
Install the language server on the host; Digitorn does not bundle them.
Cross-references
- Hook wiring: Tool Hooks
- Module reference: lsp module
- Filesystem edits: filesystem