astro: Fix broken language injections (#11830)

Update upstream
4be180759e
This will solve #11827

Before:
<img width="644" alt="image"
src="https://github.com/zed-industries/zed/assets/45585937/f6b10667-9197-4e5d-8513-78ce3d22f9e7">
After:
<img width="700" alt="image"
src="https://github.com/zed-industries/zed/assets/45585937/7bd7b0e6-e73c-4d1d-abd6-d6b2d88e97a6">


Release Notes:

- N/A
This commit is contained in:
d1y 2024-05-15 06:57:10 +08:00 committed by GitHub
parent 43be375c76
commit af79e6b423
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View file

@ -12,4 +12,4 @@ language = "Astro"
[grammars.astro]
repository = "https://github.com/virchau13/tree-sitter-astro"
commit = "dfa0893bdc4bdfada102043404758c66e3580568"
commit = "4be180759ec13651f72bacee65fa477c64222a1a"

View file

@ -1,16 +1,21 @@
; inherits: html_tags
(frontmatter
(raw_text) @content
(frontmatter_js_block) @content
(#set! "language" "typescript"))
(interpolation
(raw_text) @content
(#set! "language" "tsx"))
(attribute_interpolation
(attribute_js_expr) @content
(#set! "language" "typescript"))
(html_interpolation
(permissible_text) @content
(#set! "language" "typescript"))
(script_element
(raw_text) @content
(#set! "language" "typescript"))
; TODO: add scss/less or more injections
; https://github.com/virchau13/tree-sitter-astro/blob/4be180759ec13651f72bacee65fa477c64222a1a/queries/injections.scm#L18-L27
(style_element
(raw_text) @content
(#set! "language" "css"))