# rust: Fix \`rshtml\` injection inside Leptos \`view\!\` macros \(\#45952\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e1a09e290c48fc02d07aaf2150856d77996414df)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e1a09e290c48fc02d07aaf2150856d77996414df

Requested commit: e1a09e290c48fc02d07aaf2150856d77996414df

Commit: e1a09e290c48fc02d07aaf2150856d77996414df

Tree: 2b98703265a57a26aea58133a4c88ac1a4b35ac9

Author: Arhan Chaudhary

Committer: GitHub

## Message

```
rust: Fix `rshtml` injection inside Leptos `view!` macros (#45952)

Fix the Rust tree-sitter language injection to syntax highlight HTML in
Leptos `view!` macros.

A [cleanup
commit](https://github.com/zed-industries/zed/commit/00278f43bb0c5ce7c9961fca42d8e924a0cb157a#diff-15e953fedef2880e09d9e57c8bddf9af5eb583b141fe7d2069c8e579378f4fccL6)
erroneously removed the `(#not-any-of? @_macro_name "view" "html")`
filter from a query that injects Rust into macro invocations. This
causes the query to always match with higher precedence over another one
that sets the `view!` macro language to `rstml`. I have verified that my
fix works locally.

On a related note, I am not sure why language injection for the `sql`
macro is there, which is not even exported by
[sqlx](https://docs.rs/sqlx/latest/sqlx/). The commit author
[mentions](https://github.com/zed-industries/zed/pull/41258#issue-3555384722)
that it is for `sqlez`, a Go library, not a Rust crate.

Release Notes:

- Fixed rshtml injection not working inside Leptos `view!` macros.
```

## Parents

- [3140025253815973f018ab7e53a2dc1cba41e3a0](https://git.cafe/gitcafe/zed/commit/3140025253815973f018ab7e53a2dc1cba41e3a0?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e1a09e290c48fc02d07aaf2150856d77996414df?format=markdown)
