Expand description
OptionsGenerator — completion source for :set <Tab>.
Walks the registry on each invocation. The matcher (fuzzy by
default) and ranker live in lattice-completion; this generator
just produces the candidate set.
Behaviour:
- Bare prefix (no
=): emits one candidate per registered option name plus every alternate name form the option’scrate::OptionType::name_formsdeclares (boolean’snoNAME). name=prefix: looks upnamein the registry and emitsname=valuecandidates for each entry the option’scrate::ErasedOption::enumerate_valuesreturns. Free-form values (integers, paths, free strings) returnNoneand the candidate set is empty.
No knowledge of OptionKind — the generator asks the
type-erased view, which delegates to the type’s trait impl.
Adding a new option-type variant means writing one
crate::OptionType impl; completion picks it up
automatically.
Structs§
- Options
Generator - Completion source for
:set— option names, andname=valuepairs for options whose type enumerates its values.