Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

astro: Fix broken language injections (#11830)

d1yaf79e6b423da
diff --git a/extensions/astro/extension.toml b/extensions/astro/extension.toml
index 461f52e8014..df45a33b298 100644
--- a/extensions/astro/extension.toml
+++ b/extensions/astro/extension.toml
@@ -12,4 +12,4 @@ language = "Astro"
[grammars.astro]
repository = "https://github.com/virchau13/tree-sitter-astro"
-commit = "dfa0893bdc4bdfada102043404758c66e3580568"
+commit = "4be180759ec13651f72bacee65fa477c64222a1a"
diff --git a/extensions/astro/languages/astro/injections.scm b/extensions/astro/languages/astro/injections.scm
index 109ccb9778e..4647715e2be 100644
--- a/extensions/astro/languages/astro/injections.scm
+++ b/extensions/astro/languages/astro/injections.scm
@@ -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"))