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§
- Customize
Names Generator gen:customize– candidates for:customize <name>. Merges two sources:- Elements
Generator 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>.- Events
Generator gen:events– one candidate per registered event, from the unified view (event_registry::all_events): the compile-timeEVENT_DESCRIPTORSlinkme slice (built-ins) PLUS the runtime registry (plugin-defined events, PH7.8b), so a plugin’s custom events complete here the moment they register.- History
Kinds Generator - MB.5:
gen:history-kinds— completion source for:history <Tab>. Returns the two valid kind arguments:commandsandsearches. - LogLevels
Generator 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.- LspServers
Generator 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.- Modes
Generator gen:modes– one candidate per registered mode. WalksModeRegistry::iter_metaso the candidate set follows the runtime registry (built-in foundation modes plus any feature- crateregister_*_modesadditions).- Picker
Sources Generator gen:picker-sources– one candidate per source id registered with the host’sPickerRegistry. 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.- Plugin
ApiFormats Generator gen:plugin-api-formats— the two export formats:export-plugin-apiaccepts. A two-element set is still worth completing: the alternative is reading the command’s doc to learn thatmdis spelledmarkdown.- Plugin
ApiSeams Generator gen:plugin-api-seams— one candidate per WIT interface in the plugin-API catalog. Drives:describe-plugin-api <Tab>.- Plugins
Generator gen:plugins— one candidate per loaded plugin. Drives:describe-plugin <Tab>and the plugin manager’s:plugin-unload/:plugin-reload/:plugin-update.- Theme
Picker Source - T.12a:
:colorscheme(no arg) — the live-preview theme picker. A trait-drivenPickerSourceGeneratorholding a clone of theThemeRegistryHandleso it can enumerate registered theme names atinittime. Arrowing through candidates LIVE-PREVIEWS each theme (the host applies thePickerPreviewOutcome::ColorschemetheSelf::previewhook returns);<Esc>restores the theme active when the picker opened;<CR>keeps the highlighted theme. - Themes
Generator gen:themes— one candidate per registered colour theme. Drives:colorscheme <Tab>.