Skip to main content

Module generators

Module generators 

Source
Expand description

Built-in candidate generators (DESIGN.md §5.11.3).

v1 ships:

  • CommandsGenerator – every CommandSpec in the registry. Caches the full set per registry-version (commands don’t change at runtime in v1, so the cache key is fixed and the cache effectively never expires).
  • FilesGenerator – filesystem entries for a path-shaped prefix. Caches per-directory with a 1-second soft TTL.
  • DirectoriesGenerator – like FilesGenerator but only emits directory entries. Intended for :cd and similar directory-only commands.

Other host-state generators (chords, registers, marks, buffers) live in lattice-ui-tui because they need App-level state. Plugins register their own through the same trait.

Structs§

CommandsGenerator
gen:commands. Walks the CommandRegistry and emits one RawCandidate per registered CommandSpec. Filtering is deferred to the matcher; the generator returns the full set every time the cache misses.
DirectoriesGenerator
gen:directories. Resolves the prefix into a directory + basename pattern, then lists only directories of that directory matching the basename prefix. Like FilesGenerator but omits regular files.
FilesGenerator
gen:files. Resolves the prefix into a directory + basename pattern, then lists entries of that directory matching the basename prefix. Returns directories with a trailing / so the user can keep tab-completing into nested paths.

Functions§

path_entries
PC.9: [fs_entries] without the completion engine’s context.