diff options
| author | Sergio Alejandro Vargas <savargasqu+git@unal.edu.co> | 2021-11-05 11:18:39 -0500 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2021-11-25 23:53:41 +0100 |
| commit | 81f75a54ff53db17448abd86620d7d0b0cab617a (patch) | |
| tree | 10128b717a518a729956474626ade8e72adc00d9 | |
| parent | Rename queries: godotResource -> godot_resource (diff) | |
| download | nvim-treesitter-81f75a54ff53db17448abd86620d7d0b0cab617a.tar nvim-treesitter-81f75a54ff53db17448abd86620d7d0b0cab617a.tar.gz nvim-treesitter-81f75a54ff53db17448abd86620d7d0b0cab617a.tar.bz2 nvim-treesitter-81f75a54ff53db17448abd86620d7d0b0cab617a.tar.lz nvim-treesitter-81f75a54ff53db17448abd86620d7d0b0cab617a.tar.xz nvim-treesitter-81f75a54ff53db17448abd86620d7d0b0cab617a.tar.zst nvim-treesitter-81f75a54ff53db17448abd86620d7d0b0cab617a.zip | |
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
| -rw-r--r-- | queries/rust/highlights.scm | 116 |
1 files changed, 48 insertions, 68 deletions
diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm index 0a97e75b1..2bb77dc01 100644 --- a/queries/rust/highlights.scm +++ b/queries/rust/highlights.scm @@ -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 - -(closure_parameters "|" @punctuation.bracket) +["(" ")" "[" "]" "{" "}"] @punctuation.bracket +(closure_parameters "|" @punctuation.bracket) +(type_arguments ["<" ">"] @punctuation.bracket) +(type_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) |
