From 2dff21cc78fd2d6a4fa4f227f6ad94e3f7baa943 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 28 Jul 2026 19:11:14 +0800 Subject: feat(mingling_macros, mingling_pathf): add `#[command]` attribute macro Add a new `#[command]` attribute macro (feature-gated behind `extra_macros`) that converts a plain function with a `Vec` parameter into a fully wired Mingling command. The macro generates a `dispatcher!` call, a `#[chain]` wrapper, and a hidden module re-exporting all generated types. Also add `CommandPattern` to the pathf pattern analyzer to recognize `#[command]`-annotated functions and track their generated hidden modules. --- mingling_pathf/src/pattern_analyzer.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'mingling_pathf/src/pattern_analyzer.rs') diff --git a/mingling_pathf/src/pattern_analyzer.rs b/mingling_pathf/src/pattern_analyzer.rs index e88d9f6..79b1c5a 100644 --- a/mingling_pathf/src/pattern_analyzer.rs +++ b/mingling_pathf/src/pattern_analyzer.rs @@ -33,6 +33,7 @@ pub fn init_with_config(config: PathfinderConfig) -> PatternAnalyzer { analyzer.add_pattern(GroupPattern); analyzer.add_pattern(GroupedDerivePattern); analyzer.add_pattern(ChainPattern); + analyzer.add_pattern(CommandPattern); analyzer.add_pattern(RendererPattern); analyzer.add_pattern(HelpPattern); analyzer.add_pattern(CompletionPattern); -- cgit