Skip to main content

Module server

Module server 

Source
Expand description

The IDE server supervisor: an idle tokio task that starts/stops the loopback WebSocket listener on command.

Mirrors lattice_lsp’s supervisor shape: a single task owns the listener lifecycle; a clone-able ClaudeCodeServerHandle drives it via a non-blocking cmd_tx send. The ex-command apply closures (:claude-code-start / :claude-code-stop) and claude-code-mode’s on_activate (I5) hold the handle and call start / stop.

All protocol I/O happens off the editor thread: the supervisor task and one task per connection run on the IDE runtime. The editor thread only ever calls start / stop (a channel send) and reads the wait-free ServerState snapshot.

Structs§

ClaudeCodeServerHandle
Handle to the supervisor. Clone-able + Send + Sync: the ex-command apply closures and claude-code-mode’s on_activate hold one and drive start / stop. Mirrors lattice_lsp::LspSupervisorHandle.
ServerConfig
Static config the server binds with.
ServerState
Wait-free snapshot of server state for status reads (headerline, I7).

Functions§

spawn
Spawn the supervisor task on rt. Returns immediately; the task stays idle until start().