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§
- Command
Line Slot - What the cursor on the
:line is pointing at.
Functions§
- current_
slot - Detect what slot the cursor is on.
lineis the text on the command line (without the leading:);cursoris a byte offset withinline(0..=line.len()).