Skip to main content

Module host_generators

Module host_generators 

Source
Expand description

App-state-dependent completion generators.

lattice-completion’s built-in generators (gen:commands, gen:files) and lattice-config’s gen:options cover the state-free / config-tier sources. gen:help-topics lives in lattice-help next to the topic registry. Everything else – sources that need App-level handles (mode registry, event descriptors, LSP supervisor) – lives here so the cmdline can offer <Tab> candidates for every described command in lattice_grammar::ex_commands.

Each generator captures the minimal Arc<...> slice of state it needs and is registered in App::new next to the existing gen:options registration. Names are stable – they appear as string literals in ArgSpec::completion – so adding a new generator means registering it here and pointing the relevant arg schemas at it.

Structs§

CustomizeNamesGenerator
gen:customize – candidates for :customize <name>. Merges two sources:
ElementsGenerator
gen:elements – one candidate per registered theme element / face. Walks [ThemeRegistry::element_names] so the candidate set follows the live registry (core elements plus any mode/plugin-contributed ones). Drives :describe-element <Tab> / :describe-face <Tab>.
EventsGenerator
gen:events – one candidate per registered event, from the unified view (event_registry::all_events): the compile-time EVENT_DESCRIPTORS linkme slice (built-ins) PLUS the runtime registry (plugin-defined events, PH7.8b), so a plugin’s custom events complete here the moment they register.
HistoryKindsGenerator
MB.5: gen:history-kinds — completion source for :history <Tab>. Returns the two valid kind arguments: commands and searches.
LogLevelsGenerator
gen:log-levels – the five canonical log levels accepted by :lsp-log-level. Returned in severity order so the popup reads the same way the level enum does.
LspServersGenerator
gen:lsp-servers – one candidate per currently running LSP server id. Reads through the supervisor’s wait-free snapshot (ArcSwap-backed) so completion never blocks on the supervisor task. Dedup-by-id across multi-workspace runs: the same server id attached to two different roots collapses to one candidate.
ModesGenerator
gen:modes – one candidate per registered mode. Walks ModeRegistry::iter_meta so the candidate set follows the runtime registry (built-in foundation modes plus any feature- crate register_*_modes additions).
PickerSourcesGenerator
gen:picker-sources – one candidate per source id registered with the host’s PickerRegistry. Drives :picker <Tab> completion; the registry’s contents dictate the candidate set, so feature crates that register new picker sources automatically surface in the popup.
PluginApiFormatsGenerator
gen:plugin-api-formats — the two export formats :export-plugin-api accepts. A two-element set is still worth completing: the alternative is reading the command’s doc to learn that md is spelled markdown.
PluginApiSeamsGenerator
gen:plugin-api-seams — one candidate per WIT interface in the plugin-API catalog. Drives :describe-plugin-api <Tab>.
PluginsGenerator
gen:plugins — one candidate per loaded plugin. Drives :describe-plugin <Tab> and the plugin manager’s :plugin-unload / :plugin-reload / :plugin-update.
ThemePickerSource
T.12a: :colorscheme (no arg) — the live-preview theme picker. A trait-driven PickerSourceGenerator holding a clone of the ThemeRegistryHandle so it can enumerate registered theme names at init time. Arrowing through candidates LIVE-PREVIEWS each theme (the host applies the PickerPreviewOutcome::Colorscheme the Self::preview hook returns); <Esc> restores the theme active when the picker opened; <CR> keeps the highlighted theme.
ThemesGenerator
gen:themes — one candidate per registered colour theme. Drives :colorscheme <Tab>.