Skip to content

Commit

Permalink
add prisma tree-sitter and lsp support (#2703)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
  • Loading branch information
Ivan and the-mikedavis authored Jun 12, 2022
1 parent e9283b2 commit 0bc7259
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
| org || | | |
| perl |||| |
| php |||| `intelephense` |
| prisma || | | `prisma-language-server` |
| prolog | | | | `swipl` |
| protobuf || || |
| python |||| `pylsp` |
Expand Down
14 changes: 14 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1449,3 +1449,17 @@ indent = { tab-width = 2, unit = "\t" }
[[grammar]]
name = "openscad"
source = { git = "https://github.com/bollian/tree-sitter-openscad", rev = "5c3ce93df0ac1da7197cf6ae125aade26d6b8972" }

[[language]]
name = "prisma"
scope = "source.prisma"
injection-regex = "prisma"
file-types = ["prisma"]
roots = ["package.json"]
comment-token = "//"
language-server = { command = "prisma-language-server", args = ["--stdio"] }
indent = { tab-width = 2, unit = " " }

[[grammar]]
name = "prisma"
source = { git = "https://github.com/victorhqc/tree-sitter-prisma", rev = "17a59236ac25413b81b1613ea6ba5d8d52d7cd6c" }
56 changes: 56 additions & 0 deletions runtime/queries/prisma/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
(string) @string

(enumeral) @constant
(number) @constant.numeric

(variable) @variable
(column_type) @type

(arguments) @variable.other.member
(model_declaration (identifier) @type)

[
"datasource"
"enum"
"generator"
"model"
"type"
] @keyword

[
(comment)
(developer_comment)
] @comment

[
(attribute)
(block_attribute_declaration)
(call_expression)
] @function.builtin

[
(true)
(false)
(null)
] @constant.builtin.boolean

[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket

[
":"
","
] @punctuation.delimiter

[
"="
"@"
"@@"
(binary_expression)
] @operator

0 comments on commit 0bc7259

Please sign in to comment.