on master help sign in
feat(languages): jsonnet (#3714)

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

commit5ab85283e944b9b0409c70953c7655b9c5f84067 authorMatouš Dzivjak <matousdzivjak@gmail.com> dateThu 8 Sep 2022, 16:04 (4 years ago) parent16ce036
3 files changed+51
book/src/generated/lang-support.md+1 languages.toml+12 runtime/queries/jsonnet/highlights.scm+38
book/src/generated/lang-support.md+1
@@ -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+12
@@ -1726,3 +1726,15 @@ roots = []
17261726[[grammar]]
17271727name = "sml"
17281728source = { 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" }
runtime/queries/jsonnet/highlights.scmnew file+38
@@ -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