SlashAutocomplete
Category: UI
Source: slash_autocomplete.dart
Classes
SlashAutocomplete
Controls slash command autocomplete state.
Two modes:
- Name mode: buffer is
/prefixwith no space — filters registry by command name / alias. - Arg mode: buffer is
/<knownCmd> <partial>and the resolved command has a [SlashArgCompleter] attached — filters that command's argument candidates.
The overlay itself only renders — the owning widget (App) intercepts keys and calls [update]/[accept]. [ShellAutocomplete] is the only other overlay with a similar mid-buffer splice pattern, but it only activates in bash mode, so there is no collision risk with slash commands.
Constructor
dart
SlashAutocomplete(this._registry)Properties
| Property | Type | Description |
|---|---|---|
maxVisible | const | |
active | bool get | |
selected | int get | |
matchCount | int get | |
active | bool get | |
selected | int get | |
matchCount | int get | |
selectedText | String? get | The full command text the current selection would set. Used by the router to detect "Enter on an already-accepted selection" and submit instead of re-accepting. |
overlayHeight | int get |
Methods
void dismiss()
void update(String buffer, int cursor)
Update autocomplete state based on the current editor buffer.