fix(rust): remove if_let from indent captures

fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/3073
This commit is contained in:
kiyan 2022-07-02 11:49:19 +02:00 committed by Stephan Seitz
parent 1b6debcf69
commit 8bc4d046e7
3 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,7 @@
fn foo() -> i32 {
if let Some(v) = Some(2) {
1
} else {
2
}
}

View file

@ -22,6 +22,9 @@ describe("indent Rust:", function()
run:new_line("cond.rs", { on_line = 4, text = "x += 1;", indent = 8 })
run:new_line("cond.rs", { on_line = 6, text = "x += 1;", indent = 8 })
run:new_line("cond.rs", { on_line = 8, text = "x += 1;", indent = 4 })
run:new_line("if_let_cond.rs", { on_line = 2, text = "let a = 1;", indent = 8 })
run:new_line("if_let_cond.rs", { on_line = 4, text = "let a = 1;", indent = 8 })
run:new_line("if_let_cond.rs", { on_line = 6, text = "let a = 1;", indent = 4 })
run:new_line("enum.rs", { on_line = 2, text = "Q,", indent = 4 })
run:new_line("enum.rs", { on_line = 4, text = "i32,", indent = 8 })
run:new_line("enum.rs", { on_line = 8, text = "z: u32,", indent = 8 })