From 0ac7e1804227ceaf1a9dc691c799da5312ffc282 Mon Sep 17 00:00:00 2001 From: mantou132 <709922234@qq.com> Date: Wed, 11 Jun 2025 01:43:11 +0800 Subject: [PATCH 1/2] Support template string inline css --- Cargo.lock | 3 +-- Cargo.toml | 2 +- crates/languages/src/javascript/injections.scm | 4 ++-- crates/languages/src/typescript/injections.scm | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 224aa421a6..0e8c21b8c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16738,8 +16738,7 @@ dependencies = [ [[package]] name = "tree-sitter-css" version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad6489794d41350d12a7fbe520e5199f688618f43aace5443980d1ddcf1b29e" +source = "git+https://github.com/mantou132/tree-sitter-css?rev=62bb39a376ee8aa0ceb6cab27474b7c7136913b9#62bb39a376ee8aa0ceb6cab27474b7c7136913b9" dependencies = [ "cc", "tree-sitter-language", diff --git a/Cargo.toml b/Cargo.toml index da2ed94ac4..e1fee18897 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -582,7 +582,7 @@ tree-sitter = { version = "0.25.6", features = ["wasm"] } tree-sitter-bash = "0.25.0" tree-sitter-c = "0.23" tree-sitter-cpp = "0.23" -tree-sitter-css = "0.23" +tree-sitter-css = { git = "https://github.com/mantou132/tree-sitter-css", rev = "62bb39a376ee8aa0ceb6cab27474b7c7136913b9" } tree-sitter-diff = "0.1.0" tree-sitter-elixir = "0.3" tree-sitter-embedded-template = "0.23.0" diff --git a/crates/languages/src/javascript/injections.scm b/crates/languages/src/javascript/injections.scm index 7baba5f227..c41cc05992 100644 --- a/crates/languages/src/javascript/injections.scm +++ b/crates/languages/src/javascript/injections.scm @@ -7,8 +7,8 @@ (call_expression function: (identifier) @_name (#eq? @_name "css") - arguments: (template_string (string_fragment) @injection.content - (#set! injection.language "css")) + arguments: (template_string) @injection.content + (#set! injection.language "css") ) (call_expression diff --git a/crates/languages/src/typescript/injections.scm b/crates/languages/src/typescript/injections.scm index 7affdc5b75..fbdca91edc 100644 --- a/crates/languages/src/typescript/injections.scm +++ b/crates/languages/src/typescript/injections.scm @@ -11,8 +11,8 @@ (call_expression function: (identifier) @_name (#eq? @_name "css") - arguments: (template_string (string_fragment) @injection.content - (#set! injection.language "css")) + arguments: (template_string) @injection.content + (#set! injection.language "css") ) (call_expression From 0199ce57e838b3c425aaf520c1630c8f002a70df Mon Sep 17 00:00:00 2001 From: mantou132 <709922234@qq.com> Date: Fri, 18 Jul 2025 23:18:33 +0800 Subject: [PATCH 2/2] Support template string inline html --- Cargo.lock | 3 +-- Cargo.toml | 2 +- extensions/html/extension.toml | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e8c21b8c0..556ba76d03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16823,8 +16823,7 @@ dependencies = [ [[package]] name = "tree-sitter-html" version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261b708e5d92061ede329babaaa427b819329a9d427a1d710abb0f67bbef63ee" +source = "git+https://github.com/mantou132/tree-sitter-html?rev=755c2e2d664ecf6f663106544517bb578beba6a8#755c2e2d664ecf6f663106544517bb578beba6a8" dependencies = [ "cc", "tree-sitter-language", diff --git a/Cargo.toml b/Cargo.toml index e1fee18897..5bfa3d2dff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -591,7 +591,7 @@ tree-sitter-go = "0.23" tree-sitter-go-mod = { git = "https://github.com/camdencheek/tree-sitter-go-mod", rev = "6efb59652d30e0e9cd5f3b3a669afd6f1a926d3c", package = "tree-sitter-gomod" } tree-sitter-gowork = { git = "https://github.com/zed-industries/tree-sitter-go-work", rev = "acb0617bf7f4fda02c6217676cc64acb89536dc7" } tree-sitter-heex = { git = "https://github.com/zed-industries/tree-sitter-heex", rev = "1dd45142fbb05562e35b2040c6129c9bca346592" } -tree-sitter-html = "0.23" +tree-sitter-html = { git = "https://github.com/mantou132/tree-sitter-html", rev = "755c2e2d664ecf6f663106544517bb578beba6a8" } tree-sitter-jsdoc = "0.23" tree-sitter-json = "0.24" tree-sitter-md = { git = "https://github.com/tree-sitter-grammars/tree-sitter-markdown", rev = "9a23c1a96c0513d8fc6520972beedd419a973539" } diff --git a/extensions/html/extension.toml b/extensions/html/extension.toml index 0f6ea79f56..0b36a6f6b0 100644 --- a/extensions/html/extension.toml +++ b/extensions/html/extension.toml @@ -15,5 +15,5 @@ language = "HTML" "CSS" = "css" [grammars.html] -repository = "https://github.com/tree-sitter/tree-sitter-html" -commit = "bfa075d83c6b97cd48440b3829ab8d24a2319809" +repository = "https://github.com/mantou132/tree-sitter-html" +commit = "755c2e2d664ecf6f663106544517bb578beba6a8"