mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 00:40:06 -04:00
feat: add jsonnet
This commit is contained in:
parent
72d61cd9fa
commit
f2d3d509d9
4 changed files with 88 additions and 0 deletions
|
|
@ -220,6 +220,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||||
- [x] [jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) (maintained by @steelsojka)
|
- [x] [jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) (maintained by @steelsojka)
|
||||||
- [x] [json](https://github.com/tree-sitter/tree-sitter-json) (maintained by @steelsojka)
|
- [x] [json](https://github.com/tree-sitter/tree-sitter-json) (maintained by @steelsojka)
|
||||||
- [x] [json5](https://github.com/Joakker/tree-sitter-json5) (maintained by @Joakker)
|
- [x] [json5](https://github.com/Joakker/tree-sitter-json5) (maintained by @Joakker)
|
||||||
|
- [x] [Jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) (maintained by @nawordar)
|
||||||
- [x] [JSON with comments](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) (maintained by @WhyNotHugo)
|
- [x] [JSON with comments](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) (maintained by @WhyNotHugo)
|
||||||
- [x] [julia](https://github.com/tree-sitter/tree-sitter-julia) (maintained by @mroavi, @theHamsta)
|
- [x] [julia](https://github.com/tree-sitter/tree-sitter-julia) (maintained by @mroavi, @theHamsta)
|
||||||
- [x] [kotlin](https://github.com/fwcd/tree-sitter-kotlin) (maintained by @SalBakraa)
|
- [x] [kotlin](https://github.com/fwcd/tree-sitter-kotlin) (maintained by @SalBakraa)
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,9 @@
|
||||||
"jsonc": {
|
"jsonc": {
|
||||||
"revision": "02b01653c8a1c198ae7287d566efa86a135b30d5"
|
"revision": "02b01653c8a1c198ae7287d566efa86a135b30d5"
|
||||||
},
|
},
|
||||||
|
"jsonnet": {
|
||||||
|
"revision": "0475a5017ad7dc84845d1d33187f2321abcb261d"
|
||||||
|
},
|
||||||
"julia": {
|
"julia": {
|
||||||
"revision": "0572cebf7b8e8ef5990b4d1e7f44f0b36f62922c"
|
"revision": "0572cebf7b8e8ef5990b4d1e7f44f0b36f62922c"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -370,6 +370,14 @@ list.json = {
|
||||||
maintainers = { "@steelsojka" },
|
maintainers = { "@steelsojka" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.jsonnet = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/sourcegraph/tree-sitter-jsonnet",
|
||||||
|
files = { "src/parser.c", "src/scanner.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@nawordar" },
|
||||||
|
}
|
||||||
|
|
||||||
list.css = {
|
list.css = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/tree-sitter/tree-sitter-css",
|
url = "https://github.com/tree-sitter/tree-sitter-css",
|
||||||
|
|
|
||||||
76
queries/jsonnet/highlights.scm
Normal file
76
queries/jsonnet/highlights.scm
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
[
|
||||||
|
(true)
|
||||||
|
(false)
|
||||||
|
] @boolean
|
||||||
|
|
||||||
|
(comment) @comment
|
||||||
|
(id) @variable
|
||||||
|
(import) @include
|
||||||
|
(null) @constant.builtin
|
||||||
|
(number) @number
|
||||||
|
(string) @string
|
||||||
|
|
||||||
|
(fieldname (id) @label)
|
||||||
|
|
||||||
|
[
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
"."
|
||||||
|
","
|
||||||
|
";"
|
||||||
|
":"
|
||||||
|
"::"
|
||||||
|
":::"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
(expr
|
||||||
|
operator: (_) @operator)
|
||||||
|
[
|
||||||
|
"+"
|
||||||
|
"="
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
"in" @keyword.operator
|
||||||
|
|
||||||
|
[
|
||||||
|
(local)
|
||||||
|
"assert"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
"else"
|
||||||
|
"if"
|
||||||
|
"then"
|
||||||
|
] @conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
(dollar)
|
||||||
|
(self)
|
||||||
|
] @variable.builtin
|
||||||
|
((id) @variable.builtin
|
||||||
|
(#eq? @variable.builtin "std"))
|
||||||
|
|
||||||
|
; Function declaration
|
||||||
|
(bind
|
||||||
|
function: (id) @function
|
||||||
|
params: (params
|
||||||
|
(param
|
||||||
|
identifier: (id) @parameter)))
|
||||||
|
|
||||||
|
; Function call
|
||||||
|
(expr
|
||||||
|
(expr (id) @function.call)
|
||||||
|
"("
|
||||||
|
(args
|
||||||
|
(named_argument
|
||||||
|
(id) @parameter))?
|
||||||
|
")")
|
||||||
|
|
||||||
|
(ERROR) @error
|
||||||
Loading…
Add table
Add a link
Reference in a new issue