Expand description
M.2.b.2 (2026-06-01): create_multibuffer_view — the atomic
“make me a multibuffer view” entry point that providers (and
tests) call.
Composes the five steps so providers can’t forget any:
- Allocate a
BufferId. - Build the typed
MultibufferDocumentHandlefromsources+excerpts(empty inputs are valid — async providers open empty views and stream content viaMultibufferDocumentHandle::append_excerpts). - Register the typed handle in
MultibufferRegistry(pulled fromactivator.services()). - Insert the upcast handle into
BufferStorevia H.1’sinsert_document_buffer(id, BufferKind::Multibuffer, ...). - Activate
multibuffer-modeon the buffer viaactivator.activate_major_for_kind(id, Multibuffer)— H.2’sModeRegistry::find_major_for_kindresolves the mode id from the kind.
Failures (missing BufferStore / MultibufferRegistry
service) log + return early. The activation cascade’s own
failure path publishes through ModeEvent::ModeActivationFailed.
Return type is BufferId (not Result) to match
Editor::activate_major_for_buffer_kind’s existing shape.
See docs/dev/architecture/multibuffer-views.md §3.7.
Functions§
- create_
multibuffer_ view - Atomic insert + activate-major for a multibuffer view. Returns
the freshly-allocated view
BufferId. After this call: