From a7f49fa56fecd7f44efca7e6074e5cd9e5d91c92 Mon Sep 17 00:00:00 2001 From: Thomas Wehmöller Date: Sun, 10 Oct 2021 15:09:17 +0200 Subject: Add Vue tree sitter grammar (#787) * ✨ Add vue tree sitter support * Update .gitmodules Co-authored-by: Blaž Hrastnik --- .gitmodules | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.gitmodules') diff --git a/.gitmodules b/.gitmodules index d1fc1517..95b3670b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -122,3 +122,7 @@ path = helix-syntax/languages/tree-sitter-svelte url = https://github.com/Himujjal/tree-sitter-svelte shallow = true +[submodule "helix-syntax/languages/tree-sitter-vue"] + path = helix-syntax/languages/tree-sitter-vue + url = https://github.com/ikatyang/tree-sitter-vue + shallow = true -- cgit v1.2.3-70-g09d2 From e069fb9dea0d41eedb9257050f2231b7b0b88d0e Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sat, 16 Oct 2021 03:58:04 -0500 Subject: Add highlight support for tree-sitter-query language (tsq) (#845) * add submodule on tree-sitter/tree-sitter-tsq mark tsq submodule as shallow * add tree-sitter-tsq to languages * add highlight queries for tsq * Update .gitmodules Co-authored-by: Blaž Hrastnik --- .gitmodules | 4 +++ helix-syntax/languages/tree-sitter-tsq | 1 + languages.toml | 8 ++++++ runtime/queries/tsq/highlights.scm | 46 ++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 160000 helix-syntax/languages/tree-sitter-tsq create mode 100644 runtime/queries/tsq/highlights.scm (limited to '.gitmodules') diff --git a/.gitmodules b/.gitmodules index 95b3670b..a8e6481e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -126,3 +126,7 @@ path = helix-syntax/languages/tree-sitter-vue url = https://github.com/ikatyang/tree-sitter-vue shallow = true +[submodule "helix-syntax/languages/tree-sitter-tsq"] + path = helix-syntax/languages/tree-sitter-tsq + url = https://github.com/tree-sitter/tree-sitter-tsq + shallow = true diff --git a/helix-syntax/languages/tree-sitter-tsq b/helix-syntax/languages/tree-sitter-tsq new file mode 160000 index 00000000..b665659d --- /dev/null +++ b/helix-syntax/languages/tree-sitter-tsq @@ -0,0 +1 @@ +Subproject commit b665659d3238e6036e22ed0e24935e60efb39415 diff --git a/languages.toml b/languages.toml index 7715425b..60b996c0 100644 --- a/languages.toml +++ b/languages.toml @@ -328,3 +328,11 @@ language-server = { command = "swipl", args = [ "-g", "use_module(library(lsp_server))", "-g", "lsp_server:main", "-t", "halt", "--", "stdio"] } + +[[language]] +name = "tsq" +scope = "source.tsq" +file-types = ["scm"] +roots = [] +comment-token = ";" +indent = { tab-width = 2, unit = " " } diff --git a/runtime/queries/tsq/highlights.scm b/runtime/queries/tsq/highlights.scm new file mode 100644 index 00000000..9ba5699a --- /dev/null +++ b/runtime/queries/tsq/highlights.scm @@ -0,0 +1,46 @@ +; mark the string passed #match? as a regex +(((predicate_name) @function + (capture) + (string) @string.regexp) + (#eq? @function "#match?")) + +; highlight inheritance comments +((query . (comment) @keyword.directive) + (#match? @keyword.directive "^;\ +inherits *:")) + +[ + "(" + ")" + "[" + "]" +] @punctuation.bracket + +":" @punctuation.delimiter + +[ + (one_or_more) + (zero_or_one) + (zero_or_more) +] @operator + +[ + (wildcard_node) + (anchor) +] @constant.builtin + +[ + (anonymous_leaf) + (string) +] @string + +(comment) @comment + +(field_name) @property + +(capture) @label + +(predicate_name) @function + +(escape_sequence) @escape + +(node_name) @variable -- cgit v1.2.3-70-g09d2