From 548f04fe26aa0d34b0b50412c7afe1656b6de88b Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:03:11 -0500 Subject: [PATCH] Add support for the Vento template language (#12147) Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 11 +++++++++++ runtime/queries/vento/highlights.scm | 13 +++++++++++++ runtime/queries/vento/injections.scm | 6 ++++++ 4 files changed, 31 insertions(+) create mode 100644 runtime/queries/vento/highlights.scm create mode 100644 runtime/queries/vento/injections.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index f51e9bb1d685..31d1c563e193 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -225,6 +225,7 @@ | uxntal | ✓ | | | | | v | ✓ | ✓ | ✓ | `v-analyzer` | | vala | ✓ | ✓ | | `vala-language-server` | +| vento | ✓ | | | | | verilog | ✓ | ✓ | | `svlangserver` | | vhdl | ✓ | | | `vhdl_ls` | | vhs | ✓ | | | | diff --git a/languages.toml b/languages.toml index a1e6c6e062e4..2fab0053919d 100644 --- a/languages.toml +++ b/languages.toml @@ -3960,3 +3960,14 @@ language-servers = ["ada-gpr-language-server"] [[grammar]] name = "gpr" source = { git = "https://github.com/brownts/tree-sitter-gpr", rev = "cea857d3c18d1385d1f5b66cd09ea1e44173945c" } + +[[language]] +name = "vento" +scope = "text.html.vto" +file-types = ["vto"] +block-comment-tokens = { start = "{{#", end = "#}}" } +indent = { tab-width = 4, unit = " " } + +[[grammar]] +name = "vento" +source = { git = "https://github.com/ventojs/tree-sitter-vento", rev = "3321077d7446c1b3b017c294fd56ce028ed817fe" } diff --git a/runtime/queries/vento/highlights.scm b/runtime/queries/vento/highlights.scm new file mode 100644 index 000000000000..4b0ba563f7ae --- /dev/null +++ b/runtime/queries/vento/highlights.scm @@ -0,0 +1,13 @@ +(comment) @comment + +(keyword) @keyword + +(tag + [ + "{{" + "{{-" + "}}" + "-}}" + ] @punctuation.bracket) + +"|>" @operator diff --git a/runtime/queries/vento/injections.scm b/runtime/queries/vento/injections.scm new file mode 100644 index 000000000000..2df984012480 --- /dev/null +++ b/runtime/queries/vento/injections.scm @@ -0,0 +1,6 @@ +((content) @injection.content + (#set! injection.language "html") + (#set! injection.combined)) + +((code) @injection.content + (#set! injection.language "javascript"))