FilePathProvider
File-path autocomplete provider. Triggers when the cursor is inside a token that starts with `./`, `~/`, `../`, or `@` (the same prefixes pi-tui recognizes). The provider lists the files inside the directory implied by the prefix and filters them via {@see FuzzyMatcher::filter()} on the basename. Pure-in-memory: the caller supplies a `callable(string $dir): array` directory lister so the provider itself does not call `opendir()` — this keeps it pure and testable, and lets a real harness swap in a cached or async-backed lister later. The lister returns an array of `{name: string, isDir: bool}` entries; the provider shapes them into `select-list` items with a trailing `/` for directories.
FilePathProvider::__construct()
public function __construct(Closure $lister):Parameters
| Name | Type | Description |
|---|---|---|
| $lister | \Closure(string): array<int, array{name: string, isDir: bool}> |
FilePathProvider::shouldTrigger()
public function shouldTrigger(string $text, int $cursor): boolWhether the text at the cursor begins a path worth completing.
Parameters
| Name | Type | Description |
|---|---|---|
| $text | string | |
| $cursor | int |
FilePathProvider::suggestions()
public function suggestions(string $text, int $cursor): arrayThe paths matching the fragment at the cursor.
Parameters
| Name | Type | Description |
|---|---|---|
| $text | string | |
| $cursor | int |