diff --git a/languages.toml b/languages.toml index 32fc1516..0a3554e8 100644 --- a/languages.toml +++ b/languages.toml @@ -1653,7 +1653,7 @@ language-servers = [ "svelteserver" ] [[grammar]] name = "svelte" -source = { git = "https://github.com/themixednuts/tree-sitter-htmlx", rev = "80c3e698ec7379772c7f2aecb9b4b4c4ac52ff0b", subpath = "crates/tree-sitter-svelte" } +source = { git = "https://github.com/themixednuts/tree-sitter-htmlx", rev = "c9b9cc35709fff494a3a9e41cd9471b633649e45", subpath = "crates/tree-sitter-svelte" } [[language]] name = "vue" diff --git a/runtime/queries/svelte/injections.scm b/runtime/queries/svelte/injections.scm index d40ae322..f4e408b6 100644 --- a/runtime/queries/svelte/injections.scm +++ b/runtime/queries/svelte/injections.scm @@ -1,72 +1,18 @@ -; Script elements with TypeScript aliases -((element - (start_tag - (tag_name) @_tag - (attribute - (quoted_attribute_value - (attribute_value) @_value))) - (raw_text) @injection.content) - (#match? @_tag "^[Ss][Cc][Rr][Ii][Pp][Tt]$") - (#any-of? @_value "ts" "typescript" "text/typescript") - (#set! injection.language "typescript")) - -; Script elements with explicit language -((element - (start_tag - (tag_name) @_tag - (attribute - (attribute_name) @_lang - (quoted_attribute_value - (attribute_value) @injection.language))) - (raw_text) @injection.content) - (#eq? @_tag "script") - (#eq? @_lang "lang") - (#not-any-of? @injection.language "ts" "typescript" "text/typescript")) - -; Script content defaults to JavaScript +;