Expand description
Shared completion data structures passed between the parser and suggester. Data structures shared across completion parsing, analysis, and ranking.
This module exists to give the completion engine a stable vocabulary for cursor state, command-line structure, command-tree metadata, and ranked suggestions. The parser and suggester can evolve independently as long as they keep exchanging these values.
Contract:
- types here should stay pure data and small helpers
- this layer may depend on shell tokenization details, but not on terminal painting or REPL host state
- public builders should describe the stable completion contract, not internal parser quirks
Re-exports§
pub use crate::core::shell_words::QuoteStyle;
Structs§
- ArgNode
- Positional argument definition for one command slot.
- Command
Line - Parsed command-line structure before higher-level completion analysis.
- Completion
Analysis - Full completion analysis derived from parsing and context resolution.
- Completion
Context - Resolved completion state for the cursor position.
- Completion
Node - One node in the immutable completion tree.
- Completion
Tree - Immutable completion data consumed by the engine.
- Cursor
State - Replacement details for the token currently being completed.
- Flag
Hints - Flag-name hints shared globally and overridden by provider.
- Flag
Node - Completion metadata for a flag spelling.
- Flag
Occurrence - One occurrence of a flag and the values consumed with it.
- OsVersions
- OS version suggestions shared globally or scoped by provider.
- Parsed
Line - Parser output for the full line and the cursor-local prefix.
- Request
Hint Set - Request hints shared globally and overridden by provider.
- Request
Hints - Request-form hints used to derive flag and value suggestions.
- Suggestion
- Ranked suggestion ready for formatting or rendering.
- Suggestion
Entry - Suggestion payload shown to the user and inserted on accept.
Enums§
- Completion
Request - Explicit request kind for the current cursor position.
- Context
Scope - Scope used when merging context-only flags into the cursor view.
- Match
Kind - High-level classification for a completion candidate.
- Suggestion
Output - Output emitted by the suggestion engine.
- Tail
Item - Item in the parsed tail after the command path.
- Value
Type - Semantic type for values completed by the engine.