Skip to content

Commit

Permalink
feat(languages): jsonnet (helix-editor#3714)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Davis <[email protected]>
  • Loading branch information
2 people authored and Shekhinah Memmel committed Dec 11, 2022
1 parent 40f4d2e commit 1c56a2f
Show file tree
Hide file tree
Showing 3 changed files with 51 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 @@ -53,6 +53,7 @@
| javascript |||| `typescript-language-server` |
| jsdoc || | | |
| json || || `vscode-json-language-server` |
| jsonnet || | | |
| jsx |||| `typescript-language-server` |
| julia || | | `julia` |
| kotlin || | | `kotlin-language-server` |
Expand Down
12 changes: 12 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,3 +1726,15 @@ roots = []
[[grammar]]
name = "sml"
source = { git = "https://github.com/Giorbo/tree-sitter-sml", rev = "bd4055d5554614520d4a0706b34dc0c317c6b608" }

[[language]]
name = "jsonnet"
scope = "source.jsonnet"
file-types = ["libsonnet", "jsonnet"]
roots = []
comment-token = "//"
indent = { tab-width = 2, unit = " " }

[[grammar]]
name = "jsonnet"
source = { git = "https://github.com/sourcegraph/tree-sitter-jsonnet", rev = "0475a5017ad7dc84845d1d33187f2321abcb261d" }
38 changes: 38 additions & 0 deletions runtime/queries/jsonnet/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
["if" "then" "else"] @keyword.control.conditional
[
(local)
"function"
] @keyword
(comment) @comment

(string) @string
(number) @constant.numeric
[
(true)
(false)
] @constant.builtin.boolean

(binaryop) @operator
(unaryop) @operator

(param identifier: (id) @variable.parameter)
(bind function: (id) @function)
(fieldname (id) @variable.other.member)
[
"["
"]"
"{"
"}"
] @punctuation.bracket
"for" @keyword.control.repeat
"in" @keyword.operator
[(self) (dollar)] @variable.builtin
"assert" @keyword
(null) @constant.builtin
[
":"
"::"
";"
"="
] @punctuation.delimiter
(id) @variable

0 comments on commit 1c56a2f

Please sign in to comment.