mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -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)
|
(parameter (identifier) @parameter)
|
||||||
(closure_parameters (_) @parameter)
|
(closure_parameters (_) @parameter)
|
||||||
|
|
||||||
(lifetime (identifier) @label)
|
(lifetime ["'" (identifier)] @label)
|
||||||
(loop_label (identifier) @label)
|
(loop_label ["'" (identifier)] @label)
|
||||||
|
|
||||||
(self) @variable.builtin
|
(self) @variable.builtin
|
||||||
|
|
||||||
|
|
@ -203,76 +203,56 @@
|
||||||
|
|
||||||
(escape_sequence) @string.escape
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
[
|
(type_cast_expression "as" @keyword.operator)
|
||||||
"as"
|
(use_as_clause "as" @include) ; path aliasing
|
||||||
] @keyword.operator
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"*"
|
"!"
|
||||||
"'"
|
"!="
|
||||||
"->"
|
"%"
|
||||||
"=>"
|
"%="
|
||||||
"<="
|
"&"
|
||||||
"="
|
"&&"
|
||||||
"=="
|
"&="
|
||||||
"!"
|
"*"
|
||||||
"!="
|
"*="
|
||||||
"%"
|
"+"
|
||||||
"%="
|
"+="
|
||||||
"&"
|
"-"
|
||||||
"&="
|
"-="
|
||||||
"&&"
|
"->"
|
||||||
"|"
|
".."
|
||||||
"|="
|
"..="
|
||||||
"||"
|
"/"
|
||||||
"^"
|
"/="
|
||||||
"^="
|
"<"
|
||||||
"*"
|
"<<"
|
||||||
"*="
|
"<<="
|
||||||
"-"
|
"<="
|
||||||
"-="
|
"="
|
||||||
"+"
|
"=="
|
||||||
"+="
|
"=>"
|
||||||
"/"
|
">"
|
||||||
"/="
|
">="
|
||||||
">"
|
">>"
|
||||||
"<"
|
">>="
|
||||||
">="
|
"?"
|
||||||
">>"
|
"@"
|
||||||
"<<"
|
"^"
|
||||||
">>="
|
"^="
|
||||||
"@"
|
"|"
|
||||||
".."
|
"|="
|
||||||
"..="
|
"||"
|
||||||
"?"
|
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
[
|
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
||||||
"("
|
(closure_parameters "|" @punctuation.bracket)
|
||||||
")"
|
(type_arguments ["<" ">"] @punctuation.bracket)
|
||||||
"["
|
(type_parameters ["<" ">"] @punctuation.bracket)
|
||||||
"]"
|
|
||||||
"{"
|
|
||||||
"}"
|
|
||||||
] @punctuation.bracket
|
|
||||||
|
|
||||||
(closure_parameters "|" @punctuation.bracket)
|
["," "." ":" "::" ";"] @punctuation.delimiter
|
||||||
|
|
||||||
(type_arguments
|
|
||||||
"<" @punctuation.bracket
|
|
||||||
">" @punctuation.bracket)
|
|
||||||
(type_parameters
|
|
||||||
"<" @punctuation.bracket
|
|
||||||
">" @punctuation.bracket)
|
|
||||||
|
|
||||||
[
|
|
||||||
":"
|
|
||||||
"::"
|
|
||||||
"."
|
|
||||||
";"
|
|
||||||
","
|
|
||||||
] @punctuation.delimiter
|
|
||||||
|
|
||||||
(attribute_item "#" @punctuation.special)
|
(attribute_item "#" @punctuation.special)
|
||||||
(inner_attribute_item ["#" "!"] @punctuation.special)
|
(inner_attribute_item ["!" "#"] @punctuation.special)
|
||||||
(macro_invocation "!" @function.macro) ; don't highlight `!` as an operator here
|
(macro_invocation "!" @function.macro)
|
||||||
|
(empty_type "!" @type.builtin)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue