From 9b8deaeced4f4a6f7c2492528019cc6e10c379ac Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 9 Jul 2026 20:32:59 +0800 Subject: docs: restructure dev-docs sidebar and move pages into subdirectories --- docs/dev-docs/pages/issues/.name | 1 + docs/dev-docs/pages/issues/the-mod-pathfinder.md | 64 +++++++++++++++++ docs/dev-docs/pages/issues/the-shit-time.md | 90 ++++++++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 docs/dev-docs/pages/issues/.name create mode 100644 docs/dev-docs/pages/issues/the-mod-pathfinder.md create mode 100644 docs/dev-docs/pages/issues/the-shit-time.md (limited to 'docs/dev-docs/pages/issues') diff --git a/docs/dev-docs/pages/issues/.name b/docs/dev-docs/pages/issues/.name new file mode 100644 index 0000000..f99478d --- /dev/null +++ b/docs/dev-docs/pages/issues/.name @@ -0,0 +1 @@ +Issues diff --git a/docs/dev-docs/pages/issues/the-mod-pathfinder.md b/docs/dev-docs/pages/issues/the-mod-pathfinder.md new file mode 100644 index 0000000..5f8c902 --- /dev/null +++ b/docs/dev-docs/pages/issues/the-mod-pathfinder.md @@ -0,0 +1,64 @@ +
+ A build-time analyzer that computes full module paths for Mingling types, resolving path ambiguity in macros. +
+ +## Background + +Currently, `gen_program!` requires all involved types to be `use`d within their module. Mingling lacks a complete module path analyzer — waiting for `proc-macro-span` to stabilize is clearly not practical, so a solution for obtaining module paths is needed. + +## Solution + +We plan to create an analyzer called `mingling-mod-pathf`, enabled via Mingling's `"pathf"` feature, to compute the full paths of all defined Mingling types. + +### Behavior When Enabled + +**`mingling_core`**: If the `builds` feature is enabled, introduces the `mingling::build::analyze_and_build_type_mapping()` method (analysis completed at Build-Time) + +**`mingling_macros`**: Modifies the behavior of the `gen_program!()` macro — automatically loads the mapping table from the analysis file generated by `mingling::build::analyze_and_build_type_mapping()`, and directly uses the full `mod::path` instead of `TypeName` (injected at Compile-Time) + +## Challenges + +`mingling-mod-pathf` needs to understand **all** Mingling syntax features. +Fortunately, Mingling's type creation is almost always explicit: + +```rust +mod sub { + mingling::macros::pack!(ResultMyName = String); // directly creates ..::sub::ResultMyName +} +``` + +There are a few exceptions, such as the implicit Dispatcher provided by `extra_macros`, but these can be inferred from the node name: + +```rust +dispatcher!("remote.add"); // although the type is unknown, we can infer CMDRemoteAdd and EntryRemoteAdd +``` + +And also `#[program_setup]`: + +```rust +#[program_setup] // can infer CustomSetup from the function name `custom_setup` +fn custom_setup(program: &mut Program+ This document collects the discomforts currently experienced while using Mingling. +
+ +This document collects the discomforts currently experienced while using Mingling. + +Of course, you can also contribute to this document. + +--- + +## Why is there no fallback completion logic? + +(completion) (fallback) + +Currently, Mingling's Completion only supports providing completion logic for specific subcommands, with no way to provide global completion. + +For example: + +``` +mycmd