-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: lua function declaration name highlighting
Within a function declaration, the entire function name should be the same color, regardless of whether it's a method etc., and including any punctuation within. This change also introduces new treesitter-capture highlight groups which may each be independently overridden by the user. Note: in Neovim, groups like `@x.y.z` fallback to `@x` implicitly if `@x.y.z` is not defined.
- Loading branch information
Showing
1 changed file
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
(function_declaration | ||
name: [ | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
;; some manual recursion (up to 8 fields) because ts queries don't | ||
;; support recursion up to arbitrary depths currently | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression) | ||
] @function.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @function.namespace) | ||
] @function.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @function.namespace) | ||
] @function.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @function.namespace) | ||
] @function.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @function.namespace) | ||
] @function.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @function.namespace) | ||
] @function.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @function.namespace) | ||
] @function.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @function.namespace) | ||
] @function.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @function) | ||
|
||
(method_index_expression | ||
table: [ | ||
(identifier) | ||
;; some manual recursion (up to 8 fields) because ts queries don't | ||
;; support recursion up to arbitrary depths currently | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression | ||
table: [ | ||
(identifier) | ||
(dot_index_expression) | ||
] @method.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @method.namespace) | ||
] @method.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @method.namespace) | ||
] @method.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @method.namespace) | ||
] @method.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @method.namespace) | ||
] @method.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @method.namespace) | ||
] @method.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @method.namespace) | ||
] @method.namespace | ||
"." @function.punctuation.delimiter | ||
field: (identifier) @method.namespace) | ||
] @method.namespace | ||
":" @method.punctuation.delimiter | ||
method: (identifier) @method) | ||
]) |