aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/func
Commit message (Collapse)AuthorAgeFilesLines
* fix: generate async-compatible empty do_chain fallback魏曹先生47 hours1-3/+19
| | | | | | | When a program declares no chains, the synthesized `do_chain` now respects the `async` feature by emitting a boxed future signature with a `Box::pin(async { panic! })` body, matching the trait requirement and fixing E0053 in async builds.
* refactor!: replace build.rs with compile-time macro build steps魏曹先生2 days1-19/+46
| | | | | | | | | | | | | BREAKING CHANGE: Replace the `build`/`builds` feature system with compile-time macro-driven generation. `gen_program!()` now automatically invokes `build_comp!()` and `build_pathf!()` when the `comp`/`pathf` features are enabled, eliminating the need for `build.rs` and `[build-dependencies]` blocks. This removes the `build` feature, the `mingling::build` module, and all related build-time API functions. Completion scripts are now written to `{target_directory}/mingling/` instead of `target/release/`. The `mingling_cli` uses `build_comp!("mling")` for its custom binary name.
* refactor!: replace pack! macros with derive-based pipeline types魏曹先生3 days10-571/+24
| | | | | | | | | 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 days3-126/+61
| | | | | | | 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 days4-60/+73
| | | | | | | 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-1/+1
| | | | | | | | | 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 days29-0/+29
| | | | | 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 days6-15/+16
|
* feat: pass context by reference in completion rendering魏曹先生10 days1-1/+1
|
* refactor(macros): clean up clippy lints and simplify code魏曹先生10 days9-28/+36
|
* feat: add entry metadata system with compile-time typed values魏曹先生2026-08-042-0/+102
| | | | | | | | | | | 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!: rename ErrorDispatcherNotFound to EntryFallback魏曹先生2026-08-032-4/+4
| | | | | | | | Rename the internal fallback type and its associated `ProgramCollect` plumbing from `ErrorDispatcherNotFound`/`build_dispatcher_not_found` to `EntryFallback`/`build_entry_fallback`, along with the generated enum variant and pack type. Update all documentation, examples, and tests accordingly.
* feat(core): add batch methods to Suggest and update macro魏曹先生2026-08-021-12/+31
| | | | | | | | | Add `add_suggest()` and `add_suggest_with_description()` methods to `Suggest` for ergonomic batch population of suggestion sets from collections of strings. Update the `suggest!` macro to use these new methods and accept expressions beyond string literals for suggestion items.
* refactor!: rename `extra_macros` feature to `extras`feat/new-pipeline-model魏曹先生2026-08-011-5/+5
| | | | | Update all references across docs, examples, and configuration files to use the shorter `extras` feature name.
* feat(dispatcher, gen_program): add From impl and default Entry pack type魏曹先生2026-07-282-0/+8
| | | | | | Add a `From<pack_Type> for crate::Entry` implementation in `dispatcher!()` macro and a default `Entry` pack type in `gen_program!()` for ergonomic program entry handling
* feat(macros): wrap gen_program output in a hidden module魏曹先生2026-07-283-35/+89
| | | | | | Move pathf type resolution from `program_final_gen` to `gen_program` and isolate generated code inside `__this_program_impl` to prevent namespace pollution
* refactor(macros): move pathf include from gen_program into魏曹先生2026-07-282-10/+12
| | | | program_final_gen
* refactor(pathf): move type resolution from compile-time to build-time魏曹先生2026-07-282-107/+24
|
* refactor(dispatcher): replace custom dotted-to-pascal helper with魏曹先生2026-07-281-19/+1
| | | | `just_fmt::pascal_case!`
* feat(macros): split monolith into one-macro-per-file modules魏曹先生2026-07-2624-827/+1285
|
* feat(any): make `Grouped` trait unsafe and encapsulate `AnyOutput`魏曹先生2026-07-213-13/+21
| | | | | | | | | | 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.
* feat(core): add generic parameter `C` to `StructuralData` trait魏曹先生2026-07-211-2/+2
| | | | | | | 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魏曹先生2026-07-211-0/+57
| | | | | | | 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魏曹先生2026-07-211-0/+8
| | | | | | | | | | 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魏曹先生2026-07-201-0/+4
|
* feat(macros): add compile_error hint when pathf map is missing魏曹先生2026-07-201-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)`魏曹先生2026-07-201-0/+62
| | | | | | | | | | | 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(core)!: remove `to_chain` and `to_render` from `Grouped` trait魏曹先生2026-07-201-2/+2
| | | | | Move routing methods exclusively to the `Routable` trait and update all macro-generated code to reference `Routable` instead of `Grouped`
* fix(dispatcher): qualify to_chain call with Routable trait魏曹先生2026-07-201-1/+1
|
* chore(macros): reorganize module hierarchy in mingling_macros魏曹先生2026-07-208-0/+1595
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.