diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-03 14:32:32 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-03 14:34:06 +0800 |
| commit | 52a448ca246d60f4cf88bdcde73bfed0f989c848 (patch) | |
| tree | 016c61e970d81b5beeafa6cbc2cc1eeb7aa8999b /docs/dev/pages | |
| parent | f0c2f456d6762f4219cfc0679660ad526e5faa59 (diff) | |
chore: add EntryFallback completion support
Add `#[completion(EntryFallback)]` syntax to enable custom
completion suggestions for unmatched entries, merging fallback
results with default completions via `Suggest::combine()`.
Diffstat (limited to 'docs/dev/pages')
| -rw-r--r-- | docs/dev/pages/issues/the-shit-time.md | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/docs/dev/pages/issues/the-shit-time.md b/docs/dev/pages/issues/the-shit-time.md index 9d6c429..b23854e 100644 --- a/docs/dev/pages/issues/the-shit-time.md +++ b/docs/dev/pages/issues/the-shit-time.md @@ -9,7 +9,7 @@ Of course, you can also contribute to this document. --- -## Why is there no fallback completion logic? +## Why is there no fallback completion logic? (Solved) (completion) (fallback) @@ -34,6 +34,17 @@ fn complete(ctx: &ShellContext) -> Suggest { // ... } ``` + +Final implementation: + +By adding support for `EntryFallback` (formerly `ErrorDispatcherNotFound`) to the Completion system, `EntryFallback` can now be used as a completion entry point when no subcommand is matched: + +```rust +#[completion(EntryFallback)] +fn complete_fallback(_ctx: &ShellContext) -> Suggest { + suggest! { "fallback" } +} +``` --- |
