Skip to main content

Module show_message_request

Module show_message_request 

Source
Expand description

Server-initiated window/showMessageRequest plumbing (4.4.b; BC.8e reshape).

Spec (LSP §3.16): the server emits a message at a severity level (Error / Warning / Info / Log) accompanied by a list of MessageActionItem action labels. The client displays a modal picker; the user selects one (or dismisses); the client replies with the selected MessageActionItem, or null if the user dismissed without choosing.

The user-side action set is server-defined – e.g. rust-analyzer: [{ "title": "Reload Workspace" }] after a Cargo.toml edit. Picker UI uses the existing modal picker infrastructure (P.1+) but with a synthetic source built from the action list.

BC.8e (2026-06-24): reshaped onto the generic inbound primitive (host-drained variant). ShowMessageRequestBus is now a type alias for the generic InboundBus built via make_inbound_raw: its send wakes the editor, so a server-initiated request raises the picker off-keystroke (was: no wake — it only appeared on the next keypress). Like apply-edit (BC.8d), this is the host-drained variant: the request is a deferred user choice routed through the host picker primitive (the host drain_inbound_show_message_requests registers the request — holding the oneshot in lsp_pending_show_message_requests — opens the picker, and resolves the oneshot from the accept / dismiss routing). That machinery is irreducibly &mut Editor + the host picker, so the host keeps the receiver (Editor::pending_show_message_request_rx) and the drain; the bus contributes only the structural wake. No mode-owned handler, no Effect.

Structs§

InboundShowMessageRequest
One server-initiated window/showMessageRequest request, ferried from the LSP actor to the host’s drain.
ShowMessageRequestOutcome
Result the host reports back. None = user dismissed. Some = user selected the carried action; the actor forwards this verbatim to the server.

Type Aliases§

ShowMessageRequestBus
The bus the supervisor fans out to each actor – the generic inbound primitive specialised to the show-message-request payload, built host-drained via make_inbound_raw. send wakes the editor; the host owns the matching receiver and drains it. (Was the bespoke ShowMessageRequestBus struct before BC.8e.)