Skip to main content

Module error_list_feed

Module error_list_feed 

Source
Expand description

EP.3 (2026-08-10): the language server as a second producer of the core error list.

Design: docs/dev/architecture/error-list.md §3.2–§3.3. Slice plan: docs/dev/operations/slice-plans/error-list-producers.md.

*problems*, the :error-list picker and the whole :next-error family already exist and are producer-agnostic. Feeding them from diagnostics is what turns “the errors from my last compile” into “everything currently wrong”, without a second surface to learn.

§Coalescing is not an optimisation

publishDiagnostics arrives per-URI at edit-debounce rate. Pushing a rebuilt Vec<ErrorEntry> per notification would drive allocation and a cross-thread send on every keystroke burst — the background churn paramount goal #1 forbids. Instead the feed watches DiagnosticsLayer::snapshot_revision and rebuilds at most once per quiet period.

§Scope, stated honestly

This surfaces what servers have published, which is not a workspace scan. rust-analyzer publishes workspace-wide after a check; other servers publish only for open files. Callers echo the entry count so an empty result is not misread as a clean tree.

Structs§

ErrorListFeed
Handle to the running feed. Dropping it stops the task.

Constants§

COALESCE_INTERVAL
How long the feed waits for quiet before rebuilding.

Functions§

current_entries
Build the current entry set from the layer. The pull half of the feed — used by :lsp-diagnostics-to-error-list and by the option’s false → true transition, so a snapshot and a live tick produce identical results.
entries_from_snapshot
Convert one snapshot of the diagnostics layer into error entries.
map_severity
Map LSP’s severity onto the error list’s.
poll_feed
Drive the live feed: rebuild whenever the layer’s revision moves and the caller says the option is on, at most once per COALESCE_INTERVAL.

Type Aliases§

ErrorListFeedHandle
Shared handle so boot can register the feed and the ex-command can reach the layer for a manual pull.