aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lockfile.json3
-rw-r--r--lua/nvim-treesitter/parsers.lua9
-rw-r--r--queries/ziggy_schema/highlights.scm38
-rw-r--r--queries/ziggy_schema/indents.scm3
4 files changed, 53 insertions, 0 deletions
diff --git a/lockfile.json b/lockfile.json
index 5ebfc8c29..88cf10e77 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -892,5 +892,8 @@
},
"ziggy": {
"revision": "c66f47bc632c66668d61fa06eda112b41d6e5130"
+ },
+ "ziggy_schema": {
+ "revision": "c66f47bc632c66668d61fa06eda112b41d6e5130"
}
}
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 6d445dece..a72a35687 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -2573,6 +2573,15 @@ list.ziggy = {
maintainers = { "@rockorager" },
}
+list.ziggy_schema = {
+ install_info = {
+ url = "https://github.com/kristoff-it/ziggy",
+ files = { "src/parser.c" },
+ location = "tree-sitter-ziggy-schema",
+ },
+ maintainers = { "@rockorager" },
+}
+
list.templ = {
install_info = {
url = "https://github.com/vrischmann/tree-sitter-templ",
diff --git a/queries/ziggy_schema/highlights.scm b/queries/ziggy_schema/highlights.scm
new file mode 100644
index 000000000..4e1770127
--- /dev/null
+++ b/queries/ziggy_schema/highlights.scm
@@ -0,0 +1,38 @@
+(struct_field
+ key: (_) @keyword)
+
+(tag_name) @function
+
+[
+ "unknown"
+ "any"
+ "struct"
+ "root"
+ "enum"
+ "map"
+] @keyword
+
+(identifier) @type
+
+"?" @type
+
+[
+ "bool"
+ "bytes"
+ "int"
+ "float"
+] @constant.builtin
+
+(doc_comment) @comment.documentation
+
+[
+ ","
+ "|"
+] @punctuation.delimiter
+
+[
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
diff --git a/queries/ziggy_schema/indents.scm b/queries/ziggy_schema/indents.scm
new file mode 100644
index 000000000..6f7f7b87c
--- /dev/null
+++ b/queries/ziggy_schema/indents.scm
@@ -0,0 +1,3 @@
+(struct) @indent.begin
+
+"}" @indent.end