aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src
Commit message (Collapse)AuthorAgeFilesLines
* feat(any): make `Grouped` trait unsafe and encapsulate `AnyOutput`魏曹先生31 hours5-17/+41
| | | | | | | | | | fields Declare `Grouped` as `unsafe trait` to make its soundness invariant visible. Make `AnyOutput.type_id` and `member_id` private; add public accessors and the `unsafe fn new_bare` constructor.
* fix: qualify `render` call as `ProgramCollect::render` in error path魏曹先生40 hours1-1/+1
|
* feat(macros): add `#[mlint(...)]` marker attribute macro魏曹先生41 hours1-0/+19
|
* feat(macros): add render_route macro and renderify attribute for render魏曹先生42 hours3-0/+128
| | | | pipeline error routing
* refactor(chain): replace Into turbofish with Routable::to_chain魏曹先生43 hours1-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(core): add generic parameter `C` to `StructuralData` trait魏曹先生44 hours2-8/+8
| | | | | | | Make `StructuralData` and `StructuralDataSealed` generic over a program collector type to bypass the orphan rule for `group_structural!`. This enables external types to implement `StructuralData<crate::ThisProgram>` without violating coherence.
* feat(core, macros): add r_append! macro and RenderResult::append_other魏曹先生46 hours2-0/+87
| | | | | | | Implement `RenderResult::append_other()` to merge buffered content and immediate output behavior from one result into another. Add the `r_append!` macro with both explicit buffer (`dst, src`) and implicit buffer (`src`) usage forms, re-exported from `mingling::prelude`.
* feat(core)!: replace RenderResult with buffered output model魏曹先生46 hours2-0/+74
| | | | | | | | | | Remove `Deref<Target=str>` and `render_text:String` in favor of `render_buffer:Vec<(String, RenderResultMode)>` and an `immediate_output` flag. Add `RenderResultMode` enum, `r_eprint!`/`r_eprintln!` macros, and new buffer manipulation methods (`append_to_buffer`, `eprint`, etc.). Update `Display` to trim output and remove trailing newline. Migrate all callers and tests away from `Deref` usage.
* 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)`魏曹先生3 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魏曹先生3 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魏曹先生4 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魏曹先生4 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
|
* 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(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-266-60/+60
|
* 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
|