Skip to main content

Module programmatic

Module programmatic 

Source
Expand description

Programmatic diff requests — the host-drained “open a diff and await the user’s verdict” capability that DiffSession::bind_completion was built for.

I4 (Claude Code IDE peer, openDiff): an off-thread producer (the IDE peer’s WebSocket task) sends a ProgrammaticDiffRequest over the host-drained inbound bus (lattice_mode::inbound::make_inbound_raw), whose send wakes the editor; the host drains it on the actor thread, opens a side-by-side diff (the baseline file vs the proposed text), and bind_completions the request’s response oneshot to the session. The producer awaits response directly — when the user resolves the diff (:diff-accept / :diff-reject, or a close-tab cancel that drops the session), the existing teardown (DiffSession::take_completion in tear_down_single_diff_session) fires the bound DiffOutcome back.

The type lives here, NOT in the IDE-peer crate, on purpose: the host must drain it and the open is irreducibly &mut Editor + lattice-diff types, so keeping the request a diff-subsystem type means the host references no IDE-peer internals (preserving the BC.3b invariant that the host carries zero claude-code internals beyond one install line), and a second consumer — an LSP WorkspaceEdit preview, a magit-style plugin — reuses the same bus. See StaticSource’s doc comment, which already names these consumers.

Structs§

ProgrammaticDiffRequest
A request to open an interactive side-by-side diff and block (on the producer side) until the user Keeps or Rejects it.

Type Aliases§

ProgrammaticDiffBus
The host-drained inbound bus carrying ProgrammaticDiffRequests.