aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/dispatch_tree_gen.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-25 13:29:08 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-25 13:29:08 +0800
commit757b1e412c8617cacd8ba0e428554e7f44e9d0e8 (patch)
tree976691ec144d3e3adbb88b337a4eeac63de76197 /mingling_macros/src/dispatch_tree_gen.rs
parent85e5792e2d0b0c75eb4044c0450d60c07370afa4 (diff)
fix(dispatch_tree): use proper snake_case for dispatcher static names
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`
Diffstat (limited to 'mingling_macros/src/dispatch_tree_gen.rs')
-rw-r--r--mingling_macros/src/dispatch_tree_gen.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/mingling_macros/src/dispatch_tree_gen.rs b/mingling_macros/src/dispatch_tree_gen.rs
index 66fb6e7..6b3efb9 100644
--- a/mingling_macros/src/dispatch_tree_gen.rs
+++ b/mingling_macros/src/dispatch_tree_gen.rs
@@ -1,3 +1,4 @@
+use just_fmt::snake_case;
use proc_macro2::TokenStream;
use quote::quote;
use std::collections::BTreeMap;
@@ -7,7 +8,7 @@ pub fn gen_get_nodes(entries: &[(String, String, String)]) -> TokenStream {
let mut node_entries = Vec::new();
for (node_name, _disp_type, _entry_name) in entries {
- let static_name_str = format!("__internal_dispatcher_{}", node_name.replace('.', "_"));
+ let static_name_str = format!("__internal_dispatcher_{}", snake_case!(node_name));
let static_ident = syn::Ident::new(&static_name_str, proc_macro2::Span::call_site());
let node_display_name = node_name.replace('.', " ");