Skip to content

Commit e2c7ff7

Browse files
matoousthe-mikedavis
authored andcommitted
feat(languages): jsonnet (helix-editor#3714)
Co-authored-by: Michael Davis <[email protected]>
1 parent 8a40e8c commit e2c7ff7

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

book/src/generated/lang-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
| javascript |||| `typescript-language-server` |
5454
| jsdoc || | | |
5555
| json || || `vscode-json-language-server` |
56+
| jsonnet || | | |
5657
| jsx |||| `typescript-language-server` |
5758
| julia || | | `julia` |
5859
| kotlin || | | `kotlin-language-server` |

languages.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,3 +1726,15 @@ roots = []
17261726
[[grammar]]
17271727
name = "sml"
17281728
source = { git = "https://github.com/Giorbo/tree-sitter-sml", rev = "bd4055d5554614520d4a0706b34dc0c317c6b608" }
1729+
1730+
[[language]]
1731+
name = "jsonnet"
1732+
scope = "source.jsonnet"
1733+
file-types = ["libsonnet", "jsonnet"]
1734+
roots = []
1735+
comment-token = "//"
1736+
indent = { tab-width = 2, unit = " " }
1737+
1738+
[[grammar]]
1739+
name = "jsonnet"
1740+
source = { git = "https://github.com/sourcegraph/tree-sitter-jsonnet", rev = "0475a5017ad7dc84845d1d33187f2321abcb261d" }
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
["if" "then" "else"] @keyword.control.conditional
2+
[
3+
(local)
4+
"function"
5+
] @keyword
6+
(comment) @comment
7+
8+
(string) @string
9+
(number) @constant.numeric
10+
[
11+
(true)
12+
(false)
13+
] @constant.builtin.boolean
14+
15+
(binaryop) @operator
16+
(unaryop) @operator
17+
18+
(param identifier: (id) @variable.parameter)
19+
(bind function: (id) @function)
20+
(fieldname (id) @variable.other.member)
21+
[
22+
"["
23+
"]"
24+
"{"
25+
"}"
26+
] @punctuation.bracket
27+
"for" @keyword.control.repeat
28+
"in" @keyword.operator
29+
[(self) (dollar)] @variable.builtin
30+
"assert" @keyword
31+
(null) @constant.builtin
32+
[
33+
":"
34+
"::"
35+
";"
36+
"="
37+
] @punctuation.delimiter
38+
(id) @variable

0 commit comments

Comments
 (0)