CombinedAutocompleteProvider
Combined autocomplete provider for slash commands and file paths. The PHP analog of pi-tui's `CombinedAutocompleteProvider`. Delegates to a {@see SlashCommandProvider} when the cursor follows a `/` not preceded by a non-whitespace char, and to a {@see FilePathProvider} when the cursor is inside a `./`, `~/`, `../`, or `@`-prefixed token. When neither applies, answers no completions. Both sub-providers rank matches via {@see FuzzyMatcher::filter()} so the user can type loose substrings and still see the right entries float to the top. The combined provider does NOT merge results from both sub-providers — at most one fires per cursor position, mirroring pi-tui's "type `/` for commands, Tab for files" UX.
CombinedAutocompleteProvider::__construct()
public function __construct(Milpa\Live\Tui\SlashCommandProvider $commands, Milpa\Live\Tui\FilePathProvider $files):Parameters
| Name | Type | Description |
|---|---|---|
| $commands | Milpa\Live\Tui\SlashCommandProvider | |
| $files | Milpa\Live\Tui\FilePathProvider |
CombinedAutocompleteProvider::shouldTrigger()
public function shouldTrigger(string $text, int $cursor): boolWhether any of the combined providers wants to complete at this cursor.
Parameters
| Name | Type | Description |
|---|---|---|
| $text | string | |
| $cursor | int |
CombinedAutocompleteProvider::suggestions()
public function suggestions(string $text, int $cursor): arrayThe suggestions of every provider that triggers, in provider order.
Parameters
| Name | Type | Description |
|---|---|---|
| $text | string | |
| $cursor | int |
CombinedAutocompleteProvider::acceptSuggestion()
public function acceptSuggestion(string $text, int $cursor, string $value): arrayReplaces the complete token around the cursor with a selected value.
Parameters
| Name | Type | Description |
|---|---|---|
| $text | string | |
| $cursor | int | |
| $value | string |