Skip to main content

Module completion

Module completion 

Source
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’s crate::OptionType::name_forms declares (boolean’s noNAME).
  • name= prefix: looks up name in the registry and emits name=value candidates for each entry the option’s crate::ErasedOption::enumerate_values returns. Free-form values (integers, paths, free strings) return None and 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§

OptionsGenerator
Completion source for :set — option names, and name=value pairs for options whose type enumerates its values.