Skip to main content

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​

yaml
tools:
modules:
lsp:
config:
# Optional overrides. Empty config uses built-in probes.
settle_seconds: 10
# servers:
# pyright:
# command: "pyright-langserver --stdio"
# extensions: [".py"]

Tools​

ActionPurpose
lsp.diagnosticsReturn current diagnostics for a file.
lsp.notify_changeReport that a file changed (optional new content) and return diagnostics.
lsp.reload_appRecompile 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​

json
{
"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):

LanguageTypical command
Pythonpyright-langserver --stdio
TypeScript / JStypescript-language-server --stdio
Gogopls
Rustrust-analyzer

Install the language server on the host; Digitorn does not bundle them.

Cross-references​