diff options
| author | kiyan <yazdani.kiyan@protonmail.com> | 2022-07-02 11:49:19 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-07-08 00:27:51 +0200 |
| commit | 8bc4d046e7eb6cc0e552970a7f031b8999e797f6 (patch) | |
| tree | 9685b17f70e4bf8df1c301c1e9f475372680c202 | |
| parent | Update lockfile and highlight queries (diff) | |
| download | nvim-treesitter-8bc4d046e7eb6cc0e552970a7f031b8999e797f6.tar nvim-treesitter-8bc4d046e7eb6cc0e552970a7f031b8999e797f6.tar.gz nvim-treesitter-8bc4d046e7eb6cc0e552970a7f031b8999e797f6.tar.bz2 nvim-treesitter-8bc4d046e7eb6cc0e552970a7f031b8999e797f6.tar.lz nvim-treesitter-8bc4d046e7eb6cc0e552970a7f031b8999e797f6.tar.xz nvim-treesitter-8bc4d046e7eb6cc0e552970a7f031b8999e797f6.tar.zst nvim-treesitter-8bc4d046e7eb6cc0e552970a7f031b8999e797f6.zip | |
fix(rust): remove if_let from indent captures
fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/3073
| -rw-r--r-- | queries/rust/indents.scm | 1 | ||||
| -rw-r--r-- | tests/indent/rust/if_let_cond.rs | 7 | ||||
| -rw-r--r-- | tests/indent/rust_spec.lua | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/queries/rust/indents.scm b/queries/rust/indents.scm index e6d16dadf..7eb1539e0 100644 --- a/queries/rust/indents.scm +++ b/queries/rust/indents.scm @@ -9,7 +9,6 @@ (tuple_expression) (match_arm) (match_block) - (if_let_expression) (call_expression) (assignment_expression) (arguments) diff --git a/tests/indent/rust/if_let_cond.rs b/tests/indent/rust/if_let_cond.rs new file mode 100644 index 000000000..0d6e2ef9f --- /dev/null +++ b/tests/indent/rust/if_let_cond.rs @@ -0,0 +1,7 @@ +fn foo() -> i32 { + if let Some(v) = Some(2) { + 1 + } else { + 2 + } +} diff --git a/tests/indent/rust_spec.lua b/tests/indent/rust_spec.lua index dda495687..795765ba5 100644 --- a/tests/indent/rust_spec.lua +++ b/tests/indent/rust_spec.lua @@ -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 }) |
