Skip to main content

create_problems_view

Function create_problems_view 

Source
pub fn create_problems_view(
    activator: &mut dyn ModeActivator,
    entries: &[ErrorEntry],
    registry: CommandRegistryHandle,
    lang_registry: Option<Arc<LangRegistry>>,
) -> Option<BufferId>
Expand description

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).

Grouping is stable: files appear in first-seen order; within a file, entries are ordered by line. Each entry becomes one excerpt of ±[CONTEXT] lines around its location, clamped to the file’s line count.

Source loading mirrors providers::search: each unique file is read into a fresh RopeDocumentHandle via [spawn_document] and added to the view’s source map. A file that fails to read is logged and skipped (its entries drop out); the view still opens for the readable ones. Consistency with search is deliberate — no novel file-reading path.