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:
parent
43be375c76
commit
af79e6b423
2 changed files with 11 additions and 6 deletions
|
@ -12,4 +12,4 @@ language = "Astro"
|
||||||
|
|
||||||
[grammars.astro]
|
[grammars.astro]
|
||||||
repository = "https://github.com/virchau13/tree-sitter-astro"
|
repository = "https://github.com/virchau13/tree-sitter-astro"
|
||||||
commit = "dfa0893bdc4bdfada102043404758c66e3580568"
|
commit = "4be180759ec13651f72bacee65fa477c64222a1a"
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
; inherits: html_tags
|
|
||||||
(frontmatter
|
(frontmatter
|
||||||
(raw_text) @content
|
(frontmatter_js_block) @content
|
||||||
(#set! "language" "typescript"))
|
(#set! "language" "typescript"))
|
||||||
|
|
||||||
(interpolation
|
(attribute_interpolation
|
||||||
(raw_text) @content
|
(attribute_js_expr) @content
|
||||||
(#set! "language" "tsx"))
|
(#set! "language" "typescript"))
|
||||||
|
|
||||||
|
(html_interpolation
|
||||||
|
(permissible_text) @content
|
||||||
|
(#set! "language" "typescript"))
|
||||||
|
|
||||||
(script_element
|
(script_element
|
||||||
(raw_text) @content
|
(raw_text) @content
|
||||||
(#set! "language" "typescript"))
|
(#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
|
(style_element
|
||||||
(raw_text) @content
|
(raw_text) @content
|
||||||
(#set! "language" "css"))
|
(#set! "language" "css"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue