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 /mingling_core/src/comp.rs | |
| 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 'mingling_core/src/comp.rs')
| -rw-r--r-- | mingling_core/src/comp.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mingling_core/src/comp.rs b/mingling_core/src/comp.rs index a4e4f0b..021793b 100644 --- a/mingling_core/src/comp.rs +++ b/mingling_core/src/comp.rs @@ -163,7 +163,9 @@ impl CompletionHelper { } None => { trace!("using default completion"); - default_completion::<P>(ctx) + let fallback = P::do_comp(&P::build_entry_fallback(vec![]), ctx); + let default = default_completion::<P>(ctx); + fallback.combine(default) } } } |
