Skip to main content

Module references

Module references 

Source
Expand description

LR.1 (2026-08-11): the references multibuffer — every reference site as an editable excerpt.

Design: docs/dev/architecture/lsp-architecture.md §17. Slice plan: docs/dev/operations/slice-plans/lsp-references-view.md.

§Why a second surface rather than a replacement

gr opens a picker, and keeps doing so. That is the right shape for go to one of these, and the muscle memory should not move. It is the wrong shape for rename this argument at all fifteen call sites, which is what references are mostly for — and that workflow has no surface at all today.

So this is a peer, opened by :lsp-references, not a change to what gr does.

§Shape

Follows lattice_multibuffer::providers::problems rather than providers::search: the LSP layer delivers the location list over an existing channel, so this composes a delivered result and owns no scan of its own. Each unique file is read into a fresh RopeDocumentHandle and added to the view’s source map — the same source-loading shape both existing providers use, deliberately not a novel file-reading path.

§gr in the view means refresh

LspReferencesMode declares refresh_action and so inherits gr from refreshable-view-mode (RV.1). It binds no chord itself: the chord lives in exactly one place, and a copy here would be the sixth (mode-architecture.md §5.5).

Structs§

LspReferencesMode
lsp-references-mode — the provider-minor activated on a references view. An identity marker, like ProblemsMinorMode: a multibuffer with this minor active IS a references view.
LspReferencesModeGuard
LspReferencesService
Per-view state: the origin to re-query, keyed by the view’s BufferId, plus a DocumentId → BufferId index for cleanup.
ReferencesOrigin
Where the references query was issued from.

Constants§

REFRESH_ACTION
The refresh action this mode declares and handles.

Functions§

build_reference_excerpts
Group locations into per-file sources + excerpts.
create_references_view
Open a references multibuffer over locations.
refresh_references_view
LR.3 (2026-08-11): rebuild an existing references view from a fresh result set, in place.
register_references_actions
Register action:lsp-references-refresh so the mode’s declared refresh target resolves at boot.
register_references_mode
Register the provider-minor mode.

Type Aliases§

LspReferencesServiceHandle
Register and look up under THIS alias, never the inner type — the ServiceRegistry keys on TypeId, so registering an Arc<LspReferencesService> and asking for LspReferencesService silently returns None.