diff options
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 7 | ||||
| -rw-r--r-- | queries/prisma/highlights.scm | 48 |
2 files changed, 55 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 9d4d0d72..5c047108 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -780,6 +780,13 @@ list.http = { generate_requires_npm = true, }, maintainers = { "@NTBBloodbath" }, +list.prisma = { + install_info = { + url = "https://github.com/elianiva/tree-sitter-prisma", + branch = "master", + files = { "src/parser.c" }, + }, + maintainers = { "@elianiva" }, } local M = { diff --git a/queries/prisma/highlights.scm b/queries/prisma/highlights.scm new file mode 100644 index 00000000..fc9f1656 --- /dev/null +++ b/queries/prisma/highlights.scm @@ -0,0 +1,48 @@ +[ + "generator" + "datasource" + "model" + "enum" +] @keyword + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + ":" + "," +] @punctuation.special + +[ + "=" + "?" +] @operator + +(comment) @comment +(string) @string +(integer) @number +(boolean) @constant.builtin +(prisma_type) @type.builtin + +(field_type (non_null_type (identifier) @type)) +(field_type (array_type (non_null_type (identifier) @type))) + +(apply_function (identifier) @function) + +(attribute_specifier (identifier) @attribute) + +(key_value (key (identifier) @attribute)) + +(model_single_attribute (identifier) @variable.parameter) +(model_multi_attribute (identifier) @variable.parameter) + +(model_field (identifier) @property) + +((identifier) @constant + (#vim-match? @constant "^[A-Z_][A-Z\\d_]+$")) |
