aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros
Commit message (Collapse)AuthorAgeFilesLines
* fix: conditionally compile pathf_hint based on "pathf" feature魏曹先生2 days1-0/+4
|
* chore: add missing docs lint and document public API魏曹先生2 days1-0/+85
| | | | | | | Add `#![deny(missing_docs)]` across multiple crates and fill in documentation for all public items, including struct fields, enum variants, trait methods, and proc macros. Also mark two shell scripts as executable.
* feat(macros): add compile_error hint when pathf map is missing魏曹先生2 days1-30/+52
| | | | | | Use Option for load_pathf_map return type and emit a descriptive compile_error when the type mapping file cannot be loaded, guiding users to set up build.rs correctly
* feat(macros): add `#[buffer]` attribute and re-export `r_print!(ln)`魏曹先生2 days5-0/+259
| | | | | | | | | | | macros Reintroduce `r_print!` and `r_println!` macros as public exports, now supporting both explicit buffer argument and implicit `#[buffer]` attr. Add `#[buffer]` attribute macro that wraps unit-returning functions to produce a `RenderResult` with an automatically injected buffer variable. Relax `RenderResult::print()` and `println()` to accept `impl AsRef<str>`.
* feat(macros): preserve user function as standalone item in codegen魏曹先生2 days4-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魏曹先生3 days4-10/+10
| | | | | Move routing methods exclusively to the `Routable` trait and update all macro-generated code to reference `Routable` instead of `Grouped`
* feat(routeify): reorder import paths for consistency魏曹先生3 days1-1/+1
|
* feat(routeify): map `?` span to `route!` for tooling support魏曹先生3 days2-2/+31
| | | | | | Use the span of the `?` token when generating the macro invocation in the `#[routeify]` transformation, so that rust-analyzer resolves hover and go-to-definition on `?` to the `route!` macro's documentation
* fix(dispatcher): qualify to_chain call with Routable trait魏曹先生3 days1-1/+1
|
* feat(extensions): add routeify extension macro for error routing魏曹先生3 days3-40/+66
|
* chore(macros): reorganize module hierarchy in mingling_macros魏曹先生3 days25-740/+710
| | | | | | 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.
* feat(macros): add extension point mechanism for attribute macros魏曹先生3 days2-1/+169
| | | | | | | Implement an `extensions` module in `mingling_macros` that allows attribute macros to accept extension identifiers (e.g., `routeify`) which are re-dispatched as outer attributes before the core macro logic runs, enabling extensibility without modifying existing macros
* feat(macros): add Routable trait and update route! macro魏曹先生3 days1-8/+35
| | | | | | Introduce a `Routable` trait with `to_chain` and `to_render` methods, replacing direct `Grouped` usage in the `route!` macro so error branches correctly route through the rendering pipeline
* fix!: rename `Groupped` to `Grouped` across the codebase魏曹先生3 days8-58/+58
|
* feat(macros:chain): accept any return type in chain functions魏曹先生4 days1-33/+21
|
* feat(macros): relax `#[help]` return type to accept `Into<RenderResult>`魏曹先生5 days2-33/+14
|
* ix(macros)!: require explicit `.into()` on chain function return values魏曹先生5 days4-152/+77
|
* feat(macros): allow `#[renderer]` to accept any return type魏曹先生5 days1-36/+10
|
* docs: add module-level documentation and improve doc comments魏曹先生6 days1-40/+40
|
* style: Reorder imports and reformat code with cargo fmt魏曹先生11 days3-5/+6
|
* refactor(examples): migrate renderers to return RenderResult and add魏曹先生11 days1-4/+6
| | | | | | | | | std::io::Write import Replace r_println!/r_print! macro usage across all example renderers with explicit RenderResult construction using std::io::Write, enabling more flexible output handling and reducing reliance on macro-side effects.
* fix(docs): correct RenderResult usage examples to use mut binding and魏曹先生11 days1-7/+10
| | | | add Write import
* feat: require renderers to return RenderResult instead of mutating one魏曹先生11 days4-262/+129
| | | | | | | BREAKING CHANGE: The `render` method on `Renderer`, `HelpRequest`, and `ProgramCollect` now returns `RenderResult` instead of taking `&mut RenderResult`. The `r_print!` and `r_println!` macros have been removed in favor of using `std::io::Write` directly on `RenderResult`.
* feat(structural_data): align type use generation with group_impl魏曹先生13 days1-2/+9
|
* chore: run cargo fmt and rearrange re-exports in mingling魏曹先生2026-07-023-6/+5
|
* fix(macros): fix false positives in entry_has_variant substring matching魏曹先生2026-07-021-4/+21
|
* Released Mingling 0.2.00.2.0魏曹先生2026-06-301-1/+1
|
* fix(macros): pass pathf_map into dispatch tree generators魏曹先生2026-06-292-31/+31
|
* feat(macros): add pathf type resolution for downcasts魏曹先生2026-06-291-29/+81
|
* refactor(pack_err): replace inline to_snake_case with just_fmt魏曹先生2026-06-291-33/+5
|
* refactor(macros): reorganize module structure and parse pathf include魏曹先生2026-06-291-6/+25
| | | | | | | inline Instead of using `include!` with generated paths, read the file at compile time and parse it into a token stream during macro expansion.
* feat(pathf): add build-time type path resolution system魏曹先生2026-06-281-0/+10
| | | | | | | Add `mingling_pathf` sub-crate and `pathf` feature for automatic resolution of Mingling type module paths at build time. Scans source files, identifies macro invocations via pattern matchers, and generates mapping files consumed by `gen_program!()`.
* feat(workspace): add mingling_pathf crate and pathf feature魏曹先生2026-06-281-0/+1
|
* feat(macros): add async mutable resource injection for `#[chain]`魏曹先生2026-06-273-27/+93
| | | | | | | Support `&mut T` resource parameters in async chain functions by using an extract-store pattern that avoids holding mutable borrows across await points. Remove the previous compile-time rejection of this combination.
* fix: use fully qualified path to get_global_set in pack_err魏曹先生2026-06-271-3/+1
|
* feat(macros, docs): register structural macros and update feature table魏曹先生2026-06-261-2/+10
|
* feat(macros): Render ResultEmpty for non-structural types魏曹先生2026-06-261-1/+7
|
* feat(macros): simplify ResultEmpty to a unit struct魏曹先生2026-06-262-6/+18
|
* refactor(general_renderer): rename to structural_renderer魏曹先生2026-06-267-61/+61
|
* feat(core): decouple structured output from Groupped trait魏曹先生2026-06-265-21/+536
| | | | | | | Introduce `StructuralData` sealed trait and `pack_structural!` / `group_structural!` / `derive(StructuralData)` macros to control structured rendering separately from grouping. `Groupped` no longer requires `Serialize`.
* fix(dispatch_tree): use proper snake_case for dispatcher static names魏曹先生2026-06-253-3/+6
| | | | | | | | | Fix the static name generation for dispatch tree nodes to use a correct snake_case conversion instead of a simple `.` to `_` replacement. Also correct the `__comp` completion dispatcher name from triple underscore to double underscore, resolving a mismatch between `register_dispatcher!` and `program_comp_gen`
* Make `dispatcher_clap` help function public魏曹先生2026-06-251-1/+1
|
* Trim whitespace from variant string after removing trailing comma魏曹先生2026-06-231-1/+1
|
* Disambiguate to_chain call via full qualification魏曹先生2026-06-231-3/+7
|
* Add entry-str dedup and registry cleanup in final gen魏曹先生2026-06-235-7/+39
|
* Add aliased syntax to `group!` macro魏曹先生2026-06-231-10/+56
| | | | | Allow `group!(Alias = TypePath)` to create a type alias and use the alias name as the enum variant, enabling more descriptive naming
* Add compile-time duplicate variant detection魏曹先生2026-06-235-10/+112
| | | | | | Add duplicate variant checks for chain, renderer, help, and completion registrations to produce a clear compile error instead of silently generating unreachable code
* Replace macro_rules dispatch with proc-macro generation魏曹先生2026-06-231-6/+107
| | | | | | | | Generate `render()` and `do_chain()` match dispatch directly in `program_final_gen`, using a compile-time `ASYNC_ENABLED` constant to select the correct sync/async signature. Removes the `__dispatch_program_renderers!` and `__dispatch_program_chains!` macros from `mingling_core`.
* Make route! macro auto-convert error types魏曹先生2026-06-221-7/+8
| | | | | | `route!()` now calls `Groupped::to_chain()` on the error branch, removing the need for callers to pre-convert with `.to_chain()` or `.to_render()`.
* Support resource injection in #[help] and #[completion魏曹先生2026-06-222-64/+187
|