tree-sitter / tree-sitter-rust

Rust grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for `if-let chain`

faptc opened this issue · comments

commented

if-let chain will soon be stable. Tracking issue for the feature: rust-lang/rust#53667

The syntax is not highlighted correctly for the let keyword.

I have this code:

fn foo(b: bool, x: Option<u32>) {
    if b && let Some(x) = x {}
}

I expect the let keyword be highlighted.

Instead, let is not highlighted:
image

perhaps let-else as well?

Yeah let-else and if-let chain would be nice.

Screen Shot 2023-04-13 at 1 13 05 PM