diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 467e4c5e54c10..a2e75c6535474 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -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` | diff --git a/languages.toml b/languages.toml index aee00f45cc3a0..9f4b19699814a 100644 --- a/languages.toml +++ b/languages.toml @@ -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" } + diff --git a/runtime/queries/jsonnet/highlights.scm b/runtime/queries/jsonnet/highlights.scm new file mode 100644 index 0000000000000..5fcc99f9df6f3 --- /dev/null +++ b/runtime/queries/jsonnet/highlights.scm @@ -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