mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 03:56:52 -04:00
highlights(rust): update operators
- sort operators - remove duplicated `*` - add missing `<<=` - highlight `as` correctly in path aliasing - highlight leading quote `'` as part of a label (not an operator) - highlight never type `!` as a type - sort and format punctuation
This commit is contained in:
parent
08243017f2
commit
81f75a54ff
1 changed files with 48 additions and 68 deletions
|
|
@ -133,8 +133,8 @@
|
|||
(parameter (identifier) @parameter)
|
||||
(closure_parameters (_) @parameter)
|
||||
|
||||
(lifetime (identifier) @label)
|
||||
(loop_label (identifier) @label)
|
||||
(lifetime ["'" (identifier)] @label)
|
||||
(loop_label ["'" (identifier)] @label)
|
||||
|
||||
(self) @variable.builtin
|
||||
|
||||
|
|
@ -203,76 +203,56 @@
|
|||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
[
|
||||
"as"
|
||||
] @keyword.operator
|
||||
(type_cast_expression "as" @keyword.operator)
|
||||
(use_as_clause "as" @include) ; path aliasing
|
||||
|
||||
[
|
||||
"*"
|
||||
"'"
|
||||
"->"
|
||||
"=>"
|
||||
"<="
|
||||
"="
|
||||
"=="
|
||||
"!"
|
||||
"!="
|
||||
"%"
|
||||
"%="
|
||||
"&"
|
||||
"&="
|
||||
"&&"
|
||||
"|"
|
||||
"|="
|
||||
"||"
|
||||
"^"
|
||||
"^="
|
||||
"*"
|
||||
"*="
|
||||
"-"
|
||||
"-="
|
||||
"+"
|
||||
"+="
|
||||
"/"
|
||||
"/="
|
||||
">"
|
||||
"<"
|
||||
">="
|
||||
">>"
|
||||
"<<"
|
||||
">>="
|
||||
"@"
|
||||
".."
|
||||
"..="
|
||||
"?"
|
||||
"!"
|
||||
"!="
|
||||
"%"
|
||||
"%="
|
||||
"&"
|
||||
"&&"
|
||||
"&="
|
||||
"*"
|
||||
"*="
|
||||
"+"
|
||||
"+="
|
||||
"-"
|
||||
"-="
|
||||
"->"
|
||||
".."
|
||||
"..="
|
||||
"/"
|
||||
"/="
|
||||
"<"
|
||||
"<<"
|
||||
"<<="
|
||||
"<="
|
||||
"="
|
||||
"=="
|
||||
"=>"
|
||||
">"
|
||||
">="
|
||||
">>"
|
||||
">>="
|
||||
"?"
|
||||
"@"
|
||||
"^"
|
||||
"^="
|
||||
"|"
|
||||
"|="
|
||||
"||"
|
||||
] @operator
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
||||
(closure_parameters "|" @punctuation.bracket)
|
||||
(type_arguments ["<" ">"] @punctuation.bracket)
|
||||
(type_parameters ["<" ">"] @punctuation.bracket)
|
||||
|
||||
(closure_parameters "|" @punctuation.bracket)
|
||||
|
||||
(type_arguments
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
(type_parameters
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
[
|
||||
":"
|
||||
"::"
|
||||
"."
|
||||
";"
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
["," "." ":" "::" ";"] @punctuation.delimiter
|
||||
|
||||
(attribute_item "#" @punctuation.special)
|
||||
(inner_attribute_item ["#" "!"] @punctuation.special)
|
||||
(macro_invocation "!" @function.macro) ; don't highlight `!` as an operator here
|
||||
(inner_attribute_item ["!" "#"] @punctuation.special)
|
||||
(macro_invocation "!" @function.macro)
|
||||
(empty_type "!" @type.builtin)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue