Skip to content

Commit

Permalink
feat(languages): jsonnet
Browse files Browse the repository at this point in the history
Add jsonnet language and syntax highlight
  • Loading branch information
matoous committed Sep 5, 2022
1 parent 8882615 commit 52deb8d
Show file tree
Hide file tree
Showing 3 changed files with 41 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
13 changes: 13 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1712,3 +1712,16 @@ language-server = { command = "pasls", args = [] }
[[grammar]]
name = "pascal"
source = { git = "https://github.com/Isopod/tree-sitter-pascal", rev = "2fd40f477d3e2794af152618ccfac8d92eb72a66" }

[[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" }

27 changes: 27 additions & 0 deletions runtime/queries/jsonnet/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"if" @conditional
[
(local)
"function"
] @keyword
(comment) @comment

(string) @string
(number) @number
[
(true)
(false)
] @boolean

(binaryop) @operator
(unaryop) @operator

(id) @variable
(param identifier: (id) @variable.parameter)
(bind function: (id) @function)
(fieldname) @string.special
[
"["
"]"
"{"
"}"
] @punctuation.bracket

0 comments on commit 52deb8d

Please sign in to comment.