lsp
v0.2.0III Language Server — autocompletion, hover and diagnostics for III engine function calls and observers
Install
iii trigger compose::add worker=lspRun in your project with the iii engine running. Exact versions are immutable and digest-pinned.
lsp
Language Server Protocol implementation for the iii engine. Provides autocompletion, hover documentation, and diagnostics for iii function calls and observers directly inside any LSP-capable editor.
The server connects to a running iii engine over WebSocket, snapshots the live registry of functions (engine::functions::list, with each function's args_format, private, observable and observer_count) and observers (engine::observers::list), and serves that catalog back to the editor as completions and hover. Because the catalog is dynamic, completions reflect whatever workers are currently connected — no hand-maintained type stubs.
Supported languages
| Language | File extensions |
|---|---|
| TypeScript / TSX / JS / JSX | .ts, .tsx, .js, .jsx |
| Python | .py |
| Rust | .rs |
Other file types are passed through without analysis.
Features
- Completions — function IDs, payload properties, observe sources and targets, observer args, and known values. Offered as you type
',",:,{,, and=(for Python keyword arguments).call/call_async(iii.call({ function_id, payload }), RustCallRequest::new(id, payload)andCallRequest { function_id, .. }): every function, then thepayloadproperties of itsrequest_format.observe(source, target, options?)(TypeScript, Python, Rustobserve/observe_with): the source completes observable functions and the engine sources (engine::on-functions-changed,configuration::on-updated,observability::on-log,stream::on-changed, …), in the string shorthand, asfunction_idof the source object, or in RustSource::function(id); the target completes functions that are not private (Target::function(id)in Rust). Inside the source'sargs, keys come from the function'sargs_formatand values from itsenumand from the args of the function's current observers (cron expressions, HTTP paths, queue topics).- Known values for
stream_name,topic(andqueue) andscope, read from the filters and args of the observers ofstream::on-*,publish,queue::on-messageandstate::on-changed.
- Hover — function description, the worker that hosts it, whether it is private or not observable, its observer count and their targets, and its request, response and args JSON schemas, rendered inline. Engine sources show their description.
- Diagnostics — republished on every
did_open/did_change:- calls: unknown function IDs, IDs without a namespace, required payload fields, and the deprecated aliases
trigger,trigger_asyncandTriggerRequestofcall,call_asyncandCallRequest(a hint tagged deprecated); - observers: an unknown or non-observable source, args passed to a function without
args_format, required args missing, an unknown target, a private target,http::on-requestargs with an invalidmethod, andcron::on-tickargs whoseexpressiondoes not have 6 fields (sec min hour day month weekday) and an optional year.
- calls: unknown function IDs, IDs without a namespace, required payload fields, and the deprecated aliases
When the engine is not reachable on startup, the server stays up and returns empty completions; once the engine comes online, fresh completions become available without restarting the editor.
Run locally
cargo build --release
./target/release/lsp --url ws://127.0.0.1:49134The binary speaks LSP over stdio; spawn it from your editor's LSP client.
CLI flags
| Flag | Default | Description |
|---|---|---|
--url (env III_URL) |
ws://127.0.0.1:49134 |
WebSocket URL of the iii engine |
--stdio |
— | Accepted for editor compatibility (the server always uses stdio) |
Editor integration
VS Code / Cursor
Use the bundled VS Code extension, which downloads the matching lsp binary on first activation:
- Source: lsp-vscode/
- Marketplace: see lsp-vscode/README.md for install instructions.
Neovim (built-in LSP)
vim.lsp.config.iii = {
cmd = { '/path/to/lsp', '--url', 'ws://127.0.0.1:49134' },
filetypes = { 'typescript', 'typescriptreact', 'javascript', 'python', 'rust' },
}
vim.lsp.enable('iii')Any LSP client
Configure the client to launch the lsp binary over stdio for the supported filetypes above. No initialization options are required.
See also
- lsp-vscode/README.md — VS Code extension that wraps this binary.
- docs/sops/new-worker.md — monorepo conventions and release flow.