Expand description
D.3.f.0 (2026-05-29): FoldProvider substrate.
See docs/dev/architecture/fold-architecture.md for the
full design; capsule:
- One primary provider runs per
recompute_folds()call, keyed on:set foldmethod=. - All overlay providers run on every
recompute_folds(). - Providers are pure functions of
FoldContext; the registry pre-loads inputs.
This module ships the trait + the registry; the five
built-in primary providers wrap the existing
crate::folds helpers. Overlays are mode-owned (DX.3-C7):
diff-mode registers a HunkFoldSource and MultibufferMode
its excerpt / file-boundary sources via the FoldOverlayService.
Structs§
- Fold
Context - D.3.f.0: per-recompute inputs passed to every provider.
- Fold
Overlay Service Impl - M.7:
lattice_core::FoldOverlayServiceimpl that wraps the sharedArc<Mutex<FoldRegistry>>.MultibufferMode::on_activateobtains this viactx.service::<FoldOverlayServiceHandle>()and registersExcerptFoldProviderwithout depending onlattice-host. - Fold
Registry - D.3.f.0: per-
Editorfold-provider registry. - Fold
Source Adapter - M.7: wraps a
lattice_core::FoldSourceas aFoldProvider.target_buffer_idscopes this overlay:compute()returns empty whenctx.buffer_iddoesn’t match, so providers from multiple simultaneous multibuffers don’t bleed into each other.
Traits§
- Fold
Provider - D.3.f.0: a registered source of folds.