diff --git a/leptos_macro/src/component.rs b/leptos_macro/src/component.rs index 6138d02cc..52e5f6149 100644 --- a/leptos_macro/src/component.rs +++ b/leptos_macro/src/component.rs @@ -1360,7 +1360,10 @@ fn prop_to_doc( } pub fn unmodified_fn_name_from_fn_name(ident: &Ident) -> Ident { - Ident::new(&format!("__{ident}"), ident.span()) + Ident::new( + &format!("__component_{}", ident.to_string().to_case(Snake)), + ident.span(), + ) } /// Converts all `impl Trait`s in a function signature to use generic params instead. diff --git a/leptos_macro/src/lib.rs b/leptos_macro/src/lib.rs index a9c591103..999f4fab4 100644 --- a/leptos_macro/src/lib.rs +++ b/leptos_macro/src/lib.rs @@ -683,7 +683,11 @@ fn component_macro( let parse_result = syn::parse::(s); if let (Ok(ref mut unexpanded), Ok(model)) = (&mut dummy, parse_result) { - let expanded = model.is_transparent(is_transparent).is_lazy(is_lazy).with_island(island).into_token_stream(); + let expanded = model + .is_transparent(is_transparent) + .is_lazy(is_lazy) + .with_island(island) + .into_token_stream(); if !matches!(unexpanded.vis, Visibility::Public(_)) { unexpanded.vis = Visibility::Public(Pub { span: unexpanded.vis.span(), @@ -696,7 +700,7 @@ fn component_macro( #expanded #[doc(hidden)] - #[allow(non_snake_case, dead_code, clippy::too_many_arguments, clippy::needless_lifetimes)] + #[allow(clippy::too_many_arguments, clippy::needless_lifetimes)] #unexpanded } } else { @@ -705,7 +709,7 @@ fn component_macro( dummy.sig.ident = unmodified_fn_name_from_fn_name(&dummy.sig.ident); quote! { #[doc(hidden)] - #[allow(non_snake_case, dead_code, clippy::too_many_arguments, clippy::needless_lifetimes)] + #[allow(clippy::too_many_arguments, clippy::needless_lifetimes)] #dummy } } diff --git a/server_fn_macro/src/lib.rs b/server_fn_macro/src/lib.rs index b3eb13291..b37c414a9 100644 --- a/server_fn_macro/src/lib.rs +++ b/server_fn_macro/src/lib.rs @@ -1556,7 +1556,7 @@ impl Parse for ServerFnBody { impl ServerFnBody { fn to_dummy_ident(&self) -> Ident { - Ident::new(&format!("__{}", self.ident), self.ident.span()) + Ident::new(&format!("__server_{}", self.ident), self.ident.span()) } fn to_dummy_output(&self) -> TokenStream2 {