Skip to main content

Crate rootle_stdio

Crate rootle_stdio 

Source
Expand description

Stdio provider (plans/0005): an external child process speaking newline-delimited JSON-RPC 2.0 on stdin/stdout — the LSP model. Wrap any internal source-control system with a small script (see examples/providers/) and point [provider] command at it.

Layout: this file is the surface — state + spawn constructors. process.rs spawns the child; transport.rs owns the reader thread + reply routing; handshake.rs runs the initialize round trip; restart.rs is the respawn-with-backoff recovery machine; wire.rs maps trait Provider methods onto round trips; trace.rs emits the diagnostic records (plans/0030). Transport (plans/0008 §1): a dedicated reader thread owns the child’s stdout and routes replies by id into per-request slots. Requests wait with a deadline ([provider] timeout_ms) — one hung backend call fails instead of wedging every other call behind the io mutex, and a late reply is discarded by id-matching. Child EOF drops every pending slot, so a dead provider fails all in-flight requests immediately.

Restart (plans/0008 §5): EOF marks the transport dead; the next request respawns the child with bounded backoff, re-runs the initialize handshake, and only then proceeds. A successful restart leaves a notice (take_notice) for the status line.

Structs§

StdioProvider

Constants§

DEFAULT_TIMEOUT
Default per-request read deadline; [provider] timeout_ms.
SEARCH_LANGUAGES
Canonical search language families shared with the standalone reference adapter. TSV columns are canonical name, comma-separated aliases, extensions.