From 52a448ca246d60f4cf88bdcde73bfed0f989c848 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 3 Aug 2026 14:32:32 +0800 Subject: 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()`. --- docs/dev/pages/issues/the-shit-time.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'docs/dev') 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" } +} +``` --- -- cgit