From 5169b9a462a7a3854b8320c8d9e78985a34c5f15 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 22 Jun 2026 20:41:00 +0800 Subject: Support resource injection in #[help] and #[completion --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a0f5b5..5384b45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -195,6 +195,26 @@ group!(std::io::Error); This macro is only available with the `extra_macros` feature. +11. **\[macros\]** `#[help]` and `#[completion]` now support resource injection parameters, consistent with `#[chain]` and `#[renderer]`. Specific changes: + +- `#[help]`: Removed the restriction of "must have exactly one parameter". The first parameter still serves as the entry type, while subsequent parameters are treated as resource injections. The internal implementation was changed from a nested `help_wrapper` function to an inline body (consistent with the renderer), making resource variables visible within the scope. +- `#[completion]`: Removed the restriction of "must have exactly one parameter". The first parameter `ctx: &ShellContext` is used for the `Completion::comp` trait method signature, while subsequent parameters are treated as resource injections. Within the `comp` method body, resource bindings are injected via `::mingling::this::
().res_or_default::