tree-sitter-rust
tree-sitter-rust copied to clipboard
Support new let-else blocks
Rust 1.65 (currently in beta) will include let ... else statements. It'd be nice to have those highlighted in a way that does not cause ERRORs all over the place, but no need to haste, this is a pretty recent feature.
Example
let Some(doge) = meme.into_doge() else {
return "oh no";
}

Ideally else would be highlighted as a conditional and the normal expression highlighting just continue inside of the block then.
let_declaration [0, 0] - [0, 33]
"let" [0, 0] - [0, 3]
pattern: tuple_struct_pattern [0, 4] - [0, 14]
type: identifier [0, 4] - [0, 8]
"(" [0, 8] - [0, 9]
identifier [0, 9] - [0, 13]
")" [0, 13] - [0, 14]
"=" [0, 15] - [0, 16]
value: call_expression [0, 17] - [0, 33]
function: field_expression [0, 17] - [0, 31]
value: identifier [0, 17] - [0, 21]
"." [0, 21] - [0, 22]
field: field_identifier [0, 22] - [0, 31]
arguments: arguments [0, 31] - [0, 33]
"(" [0, 31] - [0, 32]
")" [0, 32] - [0, 33]
";" [0, 33] - [0, 33]
ERROR [0, 34] - [1, 10]
identifier [0, 34] - [0, 38]
"{" [0, 39] - [0, 40]
identifier [1, 4] - [1, 10]
expression_statement [1, 11] - [1, 19]
string_literal [1, 11] - [1, 18]
""" [1, 11] - [1, 12]
""" [1, 17] - [1, 18]
";" [1, 18] - [1, 19]
ERROR [2, 0] - [2, 1]
"}" [2, 0] - [2, 1]