Expand description
Server-initiated window/showDocument plumbing (4.4.b; BC.8c reshape).
Spec (LSP §3.16): the server asks the client to open a URI. The URI can be:
- A
file://URI – the editor opens it in a buffer. - An
http:///https://URI – the editor delegates to the OS browser whenexternal == true. - Any other scheme – best-effort; a server that asks the
client to open a non-file, non-web URI without
externalgetssuccess: false.
Optional fields:
external: bool– prefer the OS handler over an in-buffer open. Servers usually set this forhttp*URIs.take_focus: bool– give the new buffer / window focus.selection: Range– after opening, place the cursor.
BC.8c (2026-06-24): reshaped onto the generic inbound primitive.
The bespoke ShowDocumentBus (an mpsc sender with no wake, drained by a
host Editor::drain_inbound_show_documents method that itself ran
do_edit) is gone. The supervisor now holds an
InboundBus<InboundShowDocument> ([lattice_mode::inbound]) whose send
wakes the editor so a server-initiated request is answered
off-keystroke, and whose per-tick drain runs the mode-owned
make_handler below.
Unlike the configuration handler (a pure read), this handler maps each
request to a host-applied open [Effect] and resolves the oneshot
optimistically (success: true once the request maps to a valid open;
false on a non-file / malformed URI). The open effects
([Effect::OpenExternalUri], [Effect::OpenBufferAtColumn]) are
host-applied in Editor::handle_effect – they MUST run host-side
because this bus drains off-keystroke through the generic inbound
tick-callback, where peer-applied effects (OpenBuffer / OpenBufferAt)
are not forwarded. The Effect-boundary layering holds: the handler emits
generic effects + resolves its own oneshot; no lsp_types crosses into
lattice-grammar.
Structs§
- Inbound
Show Document - One server-initiated
window/showDocumentrequest, ferried from the LSP actor to the editor’s per-tick drain. - Show
Document Outcome - Result the handler reports back to the actor’s response task.
Mirrors
ShowDocumentResult.
Functions§
- make_
handler - BC.8c: the mode-owned handler for server-initiated
window/showDocument, registered viaboot.inbound::<…>().
Type Aliases§
- Show
Document Bus - The bus the supervisor fans out to each actor – the generic inbound
primitive specialised to the show-document payload.
sendwakes the editor; the per-tick drain runsmake_handler. (Was the bespokeShowDocumentBusstruct before BC.8c.)