Skip to content
Discussion options

You must be logged in to vote

Use a local Rust injection-query override and narrow the html rule to an unqualified macro. Copy the injections.scm from the runtime matching your installed Helix version to ~/.config/helix/runtime/queries/rust/injections.scm, then replace only the html block with:

((macro_invocation
   macro: (identifier) @_macro_name
   (token_tree) @injection.content)
 (#eq? @_macro_name "html")
 (#set! injection.language "html")
 (#set! injection.include-children))

That still injects HTML for bare html!, but no longer matches maud::html!, whose macro is a scoped_identifier. Keep the other rules in the copied file so Rustdoc, regex, SQL, etc. continue working. Helix documents injections.scm as the lang…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@qrhfz
Comment options

Answer selected by qrhfz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants