diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2024-02-02 00:12:17 -0500 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-02-02 08:24:59 +0100 |
| commit | 8b99311ca1171015bda7d2bb2250a1aaf2d9ea8a (patch) | |
| tree | b9fc3cb1d4fc3eade5b0e40fd9b83769c57a872b | |
| parent | chore(kconfig): update highlights (diff) | |
| download | nvim-treesitter-8b99311ca1171015bda7d2bb2250a1aaf2d9ea8a.tar nvim-treesitter-8b99311ca1171015bda7d2bb2250a1aaf2d9ea8a.tar.gz nvim-treesitter-8b99311ca1171015bda7d2bb2250a1aaf2d9ea8a.tar.bz2 nvim-treesitter-8b99311ca1171015bda7d2bb2250a1aaf2d9ea8a.tar.lz nvim-treesitter-8b99311ca1171015bda7d2bb2250a1aaf2d9ea8a.tar.xz nvim-treesitter-8b99311ca1171015bda7d2bb2250a1aaf2d9ea8a.tar.zst nvim-treesitter-8b99311ca1171015bda7d2bb2250a1aaf2d9ea8a.zip | |
chore(bicep): update queries and add scanner
| -rw-r--r-- | lockfile.json | 2 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 2 | ||||
| -rw-r--r-- | queries/bicep/highlights.scm | 33 | ||||
| -rw-r--r-- | queries/bicep/locals.scm | 7 |
4 files changed, 29 insertions, 15 deletions
diff --git a/lockfile.json b/lockfile.json index b1acc4f21..089648eeb 100644 --- a/lockfile.json +++ b/lockfile.json @@ -36,7 +36,7 @@ "revision": "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34" }, "bicep": { - "revision": "48a00c254671b5e847e615442678f4f3f5aa1e43" + "revision": "b33f29563e102f5cdf70c3bb5fd65a1bf4cc2456" }, "bitbake": { "revision": "7e0e2ac6f1d0da1a91ab84f35edddfdfece54f1a" diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index e31f19747..d74267c20 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -180,7 +180,7 @@ list.bibtex = { list.bicep = { install_info = { url = "https://github.com/amaanq/tree-sitter-bicep", - files = { "src/parser.c" }, + files = { "src/parser.c", "src/scanner.c" }, }, maintainers = { "@amaanq" }, } diff --git a/queries/bicep/highlights.scm b/queries/bicep/highlights.scm index d1f34b1e6..35c9d6c17 100644 --- a/queries/bicep/highlights.scm +++ b/queries/bicep/highlights.scm @@ -22,6 +22,9 @@ (call_expression function: (identifier) @function.call) +(user_defined_function + name: (identifier) @function) + ; Properties (object_property (identifier) @property @@ -58,12 +61,6 @@ "=" (identifier) @type) -(type_declaration - (identifier) - "=" - (array_type - (identifier) @type)) - (type (identifier) @type) @@ -89,6 +86,10 @@ (member_expression object: (identifier) @variable.parameter))) +(parameter + . + (identifier) @variable.parameter) + ; Variables (variable_declaration (identifier) @variable @@ -137,8 +138,14 @@ "targetScope" "type" "var" + "using" + "test" ] @keyword +"func" @keyword.function + +"assert" @keyword.exception + ; Operators [ "+" @@ -160,19 +167,20 @@ "??" "=" "!" + ".?" ] @operator +(subscript_expression + "?" @operator) + +(nullable_type + "?" @operator) + "in" @keyword.operator ; Literals (string) @string -(import_string - "'" @string - (import_name) @module - "@" @string.special.symbol - (import_version) @string.special) - (escape_sequence) @string.escape (number) @number @@ -204,6 +212,7 @@ [ "." + ":" "::" "=>" ] @punctuation.delimiter diff --git a/queries/bicep/locals.scm b/queries/bicep/locals.scm index 137753ae2..cc9c3c2cf 100644 --- a/queries/bicep/locals.scm +++ b/queries/bicep/locals.scm @@ -36,7 +36,8 @@ (compatible_identifier) @local.definition.field (_)) -(import_name) @local.definition.import +(user_defined_function + name: (identifier) @local.definition.function) (module_declaration (identifier) @local.definition.namespace) @@ -45,6 +46,10 @@ (identifier) @local.definition.parameter (_)) +(parameter + . + (identifier) @local.definition.parameter) + (type_declaration (identifier) @local.definition.type (_)) |
