diff --git a/crates/languages/src/rust/injections.scm b/crates/languages/src/rust/injections.scm index 0c6094ec19898eed15e9ee22d3660dfbdeedb1e0..1d346ac36bbfc0c015b73798202984714d954e58 100644 --- a/crates/languages/src/rust/injections.scm +++ b/crates/languages/src/rust/injections.scm @@ -1,7 +1,15 @@ (macro_invocation - (token_tree) @injection.content - (#set! injection.language "rust")) + macro: (identifier) @_macro_name + (#not-any-of? @_macro_name "view" "html") + (token_tree) @injection.content + (#set! injection.language "rust")) -(macro_rule - (token_tree) @injection.content - (#set! injection.language "rust")) +; we need a better way for the leptos extension to declare that +; it wants to inject inside of rust, instead of modifying the rust +; injections to support leptos injections +(macro_invocation + macro: (identifier) @_macro_name + (#any-of? @_macro_name "view" "html") + (token_tree) @injection.content + (#set! injection.language "rstml") + )