Skip to main content

Module problems

Module problems 

Source
Expand description

CM.4 (2026-07-22): the *problems* multibuffer view — the grouped, editable “problems” surface for the error list.

Design: docs/dev/architecture/compilation-mode.md §4. Slice plan: docs/dev/operations/slice-plans/compilation-mode.md (CM.4).

:copen groups the current error entries as anchored source excerpts (a few context lines around each error location), one excerpt per entry, grouped by file. The view is a regular BufferKind::Multibuffer — editable in place, edits propagate to the source via the standard M.3 pipeline — with ProblemsMinorMode as its identity marker. :cclose closes it.

Like providers::narrow (and unlike feature-gated providers::search), problems is a first-class built-in: no cargo feature gate. It reuses the exact source-loading shape the search provider uses — read each referenced file into a fresh RopeDocumentHandle (spawn_document) and add it to the view’s source map — the only difference being that the entry list is static (no async scan), so loading runs synchronously here rather than in a forwarder task.

Structs§

ProblemsMinorMode
problems-minor-mode — the provider-minor activated on a *problems* view. Pure identity marker (like NarrowMode): a multibuffer with this minor active IS a problems view, which the host’s :cclose guard reads. Editable — no ReadOnly override, so edits propagate to the source. on_activate is a no-op so the marker is cheap; the q→close chord can land in a follow-up.
ProblemsMinorModeGuard
RAII guard for ProblemsMinorMode. Unit — no subscriptions / action handlers yet (mirrors NarrowModeGuard).

Functions§

create_problems_view
Open a *problems* multibuffer view grouping entries as anchored source excerpts. Returns the new view’s BufferId, or None when entries is empty (nothing to show) or every referenced file is unreadable (no excerpt could be built).
refresh_problems_view
RV.3 (2026-08-10): rebuild an existing *problems* view from the current error list, in place. Returns the new entry count, or None when the view is unknown to the multibuffer registry or the fresh entry set yields nothing to show (in which case the view is left exactly as it was — a refresh must never blank the buffer the user is reading).
register_problems_ex_commands
Boot helper — register the :copen + :cclose ex-commands.
register_problems_mode
Boot helper — register the problems provider-minor mode. Called from [crate::install] alongside the other multibuffer modes.