diff options
| author | Cezary Drożak <cezary@drozak.net> | 2023-08-17 20:36:10 +0200 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-08-17 21:46:33 -0400 |
| commit | 4ffdc4c985fb1054fb3bfa51c28917e2d9804ca3 (patch) | |
| tree | 5fb369bde3e46c3689f6712e0d77917c51608a42 /queries/jsonnet | |
| parent | feat: add CSV, PSV, & TSV (diff) | |
| download | nvim-treesitter-4ffdc4c985fb1054fb3bfa51c28917e2d9804ca3.tar nvim-treesitter-4ffdc4c985fb1054fb3bfa51c28917e2d9804ca3.tar.gz nvim-treesitter-4ffdc4c985fb1054fb3bfa51c28917e2d9804ca3.tar.bz2 nvim-treesitter-4ffdc4c985fb1054fb3bfa51c28917e2d9804ca3.tar.lz nvim-treesitter-4ffdc4c985fb1054fb3bfa51c28917e2d9804ca3.tar.xz nvim-treesitter-4ffdc4c985fb1054fb3bfa51c28917e2d9804ca3.tar.zst nvim-treesitter-4ffdc4c985fb1054fb3bfa51c28917e2d9804ca3.zip | |
feat: update jsonnet queries
Diffstat (limited to 'queries/jsonnet')
| -rw-r--r-- | queries/jsonnet/highlights.scm | 62 |
1 files changed, 29 insertions, 33 deletions
diff --git a/queries/jsonnet/highlights.scm b/queries/jsonnet/highlights.scm index 4267c988f..189f4b9e1 100644 --- a/queries/jsonnet/highlights.scm +++ b/queries/jsonnet/highlights.scm @@ -10,7 +10,11 @@ (number) @number (string) @string -(fieldname (id) @label) +(fieldname (id) @field) +(fieldaccess + last: (id) @field) +(fieldaccess_super + (id) @field) [ "[" @@ -30,28 +34,13 @@ ":::" ] @punctuation.delimiter +; Nested field inheritance +("+" @punctuation.delimiter [":" "::" ":::"]) + +"=" @operator (unaryop) @operator -[ - "+" - "-" - "*" - "/" - "%" - "^" - "==" - "!=" - "<=" - ">=" - "<" - ">" - "=" - "&" - "|" - "<<" - ">>" - "&&" - "||" -] @operator +(binary + operator: (_) @operator) "for" @repeat @@ -61,6 +50,7 @@ [ (local) + (tailstrict) "assert" ] @keyword @@ -70,27 +60,33 @@ "then" ] @conditional +"error" @exception + [ (dollar) (self) + (super) ] @variable.builtin ((id) @variable.builtin (#eq? @variable.builtin "std")) ; Function declaration +(param + identifier: (id) @parameter) +(field + (fieldname (id) @function) + [(anonymous_function) (params)]) (bind - function: (id) @function - params: (params - (param - identifier: (id) @parameter))) + function: (id) @function) ; Function call -(expr - (expr (id) @function.call) - "(" - (args - (named_argument - (id) @parameter))? - ")") +(functioncall (id) @function.call) +(functioncall + (fieldaccess + last: (id) @function.call)) +(functioncall + (fieldaccess_super + (id) @function.call)) +(named_argument (id) @parameter) (ERROR) @error |
