mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 03:10:04 -04:00
zig: highlight zig format, type and function
This commit is contained in:
parent
011ac894ec
commit
ff2897e5b7
1 changed files with 6 additions and 2 deletions
|
|
@ -4,6 +4,10 @@
|
||||||
(line_comment)
|
(line_comment)
|
||||||
] @comment
|
] @comment
|
||||||
|
|
||||||
|
((line_comment) @text.note
|
||||||
|
(#match? @text.note "^// *zig fmt: (on|off) *$")
|
||||||
|
)
|
||||||
|
|
||||||
[
|
[
|
||||||
variable: (IDENTIFIER)
|
variable: (IDENTIFIER)
|
||||||
variable_type_function: (IDENTIFIER)
|
variable_type_function: (IDENTIFIER)
|
||||||
|
|
@ -23,7 +27,7 @@ parameter: (IDENTIFIER) @parameter
|
||||||
field_access: (IDENTIFIER)
|
field_access: (IDENTIFIER)
|
||||||
parameter: (IDENTIFIER)
|
parameter: (IDENTIFIER)
|
||||||
] @type
|
] @type
|
||||||
(#match? @type "^[A-Z]([a-z]+[A-Za-z0-9]*)*$")
|
(#match? @type "^[A-Z]")
|
||||||
)
|
)
|
||||||
;; assume camelCase is a function
|
;; assume camelCase is a function
|
||||||
(
|
(
|
||||||
|
|
@ -32,7 +36,7 @@ parameter: (IDENTIFIER) @parameter
|
||||||
field_access: (IDENTIFIER)
|
field_access: (IDENTIFIER)
|
||||||
parameter: (IDENTIFIER)
|
parameter: (IDENTIFIER)
|
||||||
] @function
|
] @function
|
||||||
(#match? @function "^[a-z]+([A-Z][a-z0-9]*)+$")
|
(#match? @function "^[a-z]+[A-Z]+")
|
||||||
)
|
)
|
||||||
|
|
||||||
;; assume all CAPS_1 is a constant
|
;; assume all CAPS_1 is a constant
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue