aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/attr
Commit message (Collapse)AuthorAgeFilesLines
* feat(macros)!: change completion context parameter to owned type魏曹先生3 days1-132/+100
| | | | | | BREAKING CHANGE: `#[completion]` functions must now take `ShellContext` by value instead of `&ShellContext`. Reference parameters are reserved for resource injection.
* feat(macros): relax completion attribute signature魏曹先生3 days1-20/+62
| | | | | | | Allow completion functions to omit the context parameter, accept owned ShellContext or any From<&ShellContext> type, and return any type implementing Into<Suggest>. Add From<&str> for SuggestItem and derive Clone for ShellContext.
* refactor!: replace pack! macros with derive-based pipeline types魏曹先生3 days1-3/+4
| | | | | | | | | Remove the `pack!`, `pack_err!`, `pack_structural!`, and `pack_err_structural!` macros, replacing all pipeline type definitions with `#[derive(Grouped)]` and `#[derive(Grouped, Wrap)]` attributes. This changes the generated struct shape from named-field structs with an `inner` field to tuple structs accessed via `.0`, and removes the auto-generated `name` and `info` fields from error types.
* refactor!: remove Node type and simplify dispatcher macro syntax魏曹先生3 days2-54/+38
| | | | | | | The `dispatcher!` macro no longer requires a `CMD*` dispatcher type argument; the dispatcher struct is now generated internally as `__Dispatcher{Pascal}`. The `Node` type, `node!` macro, and `Dispatcher::node()` / `clone_dispatcher()` methods are removed.
* refactor!: remove dynamic dispatcher registration API魏曹先生3 days2-21/+12
| | | | | | | Dispatchers are now always registered at compile time, removing the `with_dispatcher` / `with_dispatchers` methods and the `PathfinderConfig` API. The `dispatch_tree` feature now only controls the matching strategy (trie vs linear list).
* feat(core): move config types to public config module魏曹先生5 days1-2/+2
| | | | | | | | | Refactor program configuration types into a dedicated public `config` module under `mingling_core`, making `StructuralRendererSetting` accessible via `mingling_core::config` instead of the crate root. Update all internal references and setup modules to use the new `config::` path convention.
* chore: add "Doc Not Optimize" comments to source files魏曹先生6 days9-0/+9
| | | | | Mark all source files with a comment indicating they are not optimized for documentation purposes.
* refactor: simplify macro parsing code and fix clippy warnings魏曹先生9 days3-37/+39
|
* refactor(macros): clean up clippy lints and simplify code魏曹先生9 days4-67/+41
|
* feat: add entry metadata system with compile-time typed values魏曹先生2026-08-041-0/+87
| | | | | | | | | | | Add `Metadata<B>` trait and `#[metadata(Entry)]` attribute macro to attach arbitrary, compile-time-typed metadata to entries. Implement `ProgramCollect::get_metadata<T>()` for runtime retrieval, backed by a global registry populated by `register_metadata!`. Extend `pathf` with `MetadataPattern` to resolve metadata types across modules at build time. Add two examples demonstrating metadata usage with and without pathf integration.
* chore: use idiomatic boolean and reference patterns魏曹先生2026-08-031-2/+2
|
* refactor: simplify boolean and type assignment logic魏曹先生2026-08-031-3/+3
|
* fix(dispatch_tree): emit re-export token stream directly魏曹先生2026-07-281-5/+8
|
* feat(attr): allow #[command] on functions with no args param魏曹先生2026-07-281-20/+42
| | | | | | | Previously, #[command] required at least one owned parameter for args injection. Now, if the first parameter is a reference or there are no parameters, a synthetic entry parameter is inserted so the function can still be used with #[chain].
* feat(mingling_macros, mingling_pathf): add `#[command]` attribute macro魏曹先生2026-07-281-0/+340
| | | | | | | | | | | | | Add a new `#[command]` attribute macro (feature-gated behind `extra_macros`) that converts a plain function with a `Vec<String>` 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.
* feat(macros): split monolith into one-macro-per-file modules魏曹先生2026-07-262-55/+9
|
* refactor(chain): replace Into turbofish with Routable::to_chain魏曹先生2026-07-211-13/+9
| | | | | | | | Remove the `origin_return_type` parameter and replace the generic `Into` conversion with a direct call to `Routable::<#program_type>::to_chain`. For non-unit returns, also wrap the function call expression in `to_chain()` upfront to satisfy the `ChainProcess<C>` requirement of `__modify_res_and_return_route`.
* feat(macros): preserve user function as standalone item in codegen魏曹先生2026-07-204-60/+140
| | | | | | | | | | | Refactor #[chain], #[renderer], #[help], and #[completion] macros to keep the original user function as a named item instead of inlining its body. Trait method implementations now call the original function by name, injecting resources from the application context. This improves debugging (stack traces reference user function names), error messages, and macro expansion clarity.
* feat(core)!: remove `to_chain` and `to_render` from `Grouped` trait魏曹先生2026-07-202-7/+7
| | | | | Move routing methods exclusively to the `Routable` trait and update all macro-generated code to reference `Routable` instead of `Grouped`
* chore(macros): reorganize module hierarchy in mingling_macros魏曹先生2026-07-206-0/+1410
Restructure flat module layout into logical directories (attr/, derive/, func/, systems/, extensions/, utils.rs). Tighten internal function visibility to pub(crate). All public API signatures remain unchanged.