mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 00:10:04 -04:00
highlights(rust): Fix angle brackets, and closures
Highlight angle brackets in type parameters and bars in closures bars as `@punctuation.bracket` not as `@operator`.
This commit is contained in:
parent
5d019b3391
commit
0cd64db48f
1 changed files with 28 additions and 27 deletions
|
|
@ -112,32 +112,6 @@
|
||||||
(block_comment)
|
(block_comment)
|
||||||
] @comment
|
] @comment
|
||||||
|
|
||||||
[
|
|
||||||
"("
|
|
||||||
")"
|
|
||||||
"["
|
|
||||||
"]"
|
|
||||||
"{"
|
|
||||||
"}"
|
|
||||||
] @punctuation.bracket
|
|
||||||
|
|
||||||
(type_arguments
|
|
||||||
"<" @punctuation.bracket
|
|
||||||
">" @punctuation.bracket)
|
|
||||||
(type_parameters
|
|
||||||
"<" @punctuation.bracket
|
|
||||||
">" @punctuation.bracket)
|
|
||||||
|
|
||||||
[
|
|
||||||
"::"
|
|
||||||
"."
|
|
||||||
";"
|
|
||||||
","
|
|
||||||
] @punctuation.delimiter
|
|
||||||
|
|
||||||
(attribute_item "#" @punctuation.special)
|
|
||||||
(inner_attribute_item ["#" "!"] @punctuation.special)
|
|
||||||
|
|
||||||
(parameter (identifier) @parameter)
|
(parameter (identifier) @parameter)
|
||||||
(closure_parameters (_) @parameter)
|
(closure_parameters (_) @parameter)
|
||||||
|
|
||||||
|
|
@ -254,4 +228,31 @@
|
||||||
"?"
|
"?"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
(closure_parameters "|" @operator "|" @operator)
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
(closure_parameters "|" @punctuation.bracket)
|
||||||
|
|
||||||
|
(type_arguments
|
||||||
|
"<" @punctuation.bracket
|
||||||
|
">" @punctuation.bracket)
|
||||||
|
(type_parameters
|
||||||
|
"<" @punctuation.bracket
|
||||||
|
">" @punctuation.bracket)
|
||||||
|
|
||||||
|
[
|
||||||
|
"::"
|
||||||
|
"."
|
||||||
|
";"
|
||||||
|
","
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
(attribute_item "#" @punctuation.special)
|
||||||
|
(inner_attribute_item ["#" "!"] @punctuation.special)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue