aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaytan <laytanlaats@hotmail.com>2024-04-10 12:46:25 +0200
committerGitHub <noreply@github.com>2024-04-10 19:46:25 +0900
commit2bad828b48aed74efe8f7e4ea15550e18c7b482d (patch)
treef97c56ec24df62873cd905d2b51fcb96fcb838d6
parentbot(lockfile): update arduino, asm, go, odin, styled, typst, v, wing, yaml (diff)
downloadnvim-treesitter-2bad828b48aed74efe8f7e4ea15550e18c7b482d.tar
nvim-treesitter-2bad828b48aed74efe8f7e4ea15550e18c7b482d.tar.gz
nvim-treesitter-2bad828b48aed74efe8f7e4ea15550e18c7b482d.tar.bz2
nvim-treesitter-2bad828b48aed74efe8f7e4ea15550e18c7b482d.tar.lz
nvim-treesitter-2bad828b48aed74efe8f7e4ea15550e18c7b482d.tar.xz
nvim-treesitter-2bad828b48aed74efe8f7e4ea15550e18c7b482d.tar.zst
nvim-treesitter-2bad828b48aed74efe8f7e4ea15550e18c7b482d.zip
fix(odin): updates queries from upstream (#6425)
-rw-r--r--queries/odin/highlights.scm5
-rw-r--r--queries/odin/indents.scm37
-rw-r--r--queries/odin/locals.scm4
3 files changed, 37 insertions, 9 deletions
diff --git a/queries/odin/highlights.scm b/queries/odin/highlights.scm
index 6c8a7965b..5aafc4941 100644
--- a/queries/odin/highlights.scm
+++ b/queries/odin/highlights.scm
@@ -24,6 +24,7 @@
"map"
"bit_set"
"matrix"
+ "bit_field"
] @keyword
"proc" @keyword.function
@@ -151,6 +152,10 @@
(identifier) @type
"::")
+(bit_field_declaration
+ (identifier) @type
+ "::")
+
(const_declaration
(identifier) @type
"::"
diff --git a/queries/odin/indents.scm b/queries/odin/indents.scm
index 11dab0544..9c8632978 100644
--- a/queries/odin/indents.scm
+++ b/queries/odin/indents.scm
@@ -1,24 +1,43 @@
[
(block)
- (procedure_declaration)
- (overloaded_procedure_declaration)
(enum_declaration)
(union_declaration)
- (if_statement)
- (else_if_clause)
- (else_clause)
- (when_statement)
- (else_when_clause)
- (for_statement)
+ (bit_field_declaration)
+ (struct_declaration)
+ (struct)
+ (parameters)
+ (tuple_type)
+ (call_expression)
(switch_case)
] @indent.begin
+; hello(
+((identifier)
+ .
+ (ERROR
+ "(" @indent.begin))
+
[
- "}"
")"
"]"
] @indent.branch @indent.end
+; Have to do all closing brackets separately because the one for switch statements shouldn't end.
+(block
+ "}" @indent.branch @indent.end)
+
+(enum_declaration
+ "}" @indent.branch @indent.end)
+
+(union_declaration
+ "}" @indent.branch @indent.end)
+
+(struct_declaration
+ "}" @indent.branch @indent.end)
+
+(struct
+ "}" @indent.branch @indent.end)
+
[
(comment)
(block_comment)
diff --git a/queries/odin/locals.scm b/queries/odin/locals.scm
index 6c55f8a1a..3e794b2f6 100644
--- a/queries/odin/locals.scm
+++ b/queries/odin/locals.scm
@@ -30,6 +30,10 @@
(identifier) @local.definition.type
"::")
+(bit_field_declaration
+ (identifier) @local.definition.type
+ "::")
+
(variable_declaration
(identifier) @local.definition.var
":=")