Skip to main content

Module slot

Module slot 

Source
Expand description

Command-line slot detection (DESIGN.md §5.11.3).

Given the current text on the : line and a cursor position, produce a CommandLineSlot describing what the cursor is pointing at – the command name, the N-th positional arg, etc. – plus the prefix (text the user has already typed in this slot) and the byte range to replace when a candidate is accepted.

The host (cmdline parser in lattice-ui-tui) calls current_slot to figure out which completion source to invoke. The ArgSpec.completion field on each command’s arg-schema declares the source per-arg, so the slot resolution pulls the right generator id straight from the registry.

Enums§

CommandLineSlot
What the cursor on the : line is pointing at.

Functions§

current_slot
Detect what slot the cursor is on. line is the text on the command line (without the leading :); cursor is a byte offset within line (0..=line.len()).