Skip to content

Commit 52deb8d

Browse files
committed
feat(languages): jsonnet
Add jsonnet language and syntax highlight
1 parent 8882615 commit 52deb8d

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,3 +1712,16 @@ language-server = { command = "pasls", args = [] }
17121712
[[grammar]]
17131713
name = "pascal"
17141714
source = { git = "https://github.com/Isopod/tree-sitter-pascal", rev = "2fd40f477d3e2794af152618ccfac8d92eb72a66" }
1715+
1716+
[[language]]
1717+
name = "jsonnet"
1718+
scope = "source.jsonnet"
1719+
file-types = ["libsonnet", "jsonnet"]
1720+
roots = []
1721+
comment-token = "//"
1722+
indent = { tab-width = 2, unit = " " }
1723+
1724+
[[grammar]]
1725+
name = "jsonnet"
1726+
source = { git = "https://github.com/sourcegraph/tree-sitter-jsonnet", rev = "0475a5017ad7dc84845d1d33187f2321abcb261d" }
1727+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"if" @conditional
2+
[
3+
(local)
4+
"function"
5+
] @keyword
6+
(comment) @comment
7+
8+
(string) @string
9+
(number) @number
10+
[
11+
(true)
12+
(false)
13+
] @boolean
14+
15+
(binaryop) @operator
16+
(unaryop) @operator
17+
18+
(id) @variable
19+
(param identifier: (id) @variable.parameter)
20+
(bind function: (id) @function)
21+
(fieldname) @string.special
22+
[
23+
"["
24+
"]"
25+
"{"
26+
"}"
27+
] @punctuation.bracket

0 commit comments

Comments
 (0)