diff options
| author | Phạm Huy Hoàng <hoangtun0810@gmail.com> | 2024-06-29 00:26:38 +0900 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-06-28 18:13:12 +0200 |
| commit | 3e535e826da265748b875b18dbfb361bd1a1701c (patch) | |
| tree | d448a0bb04af9a99a01b904ed4f014b3d5ad2155 /tests/indent | |
| parent | bot(lockfile): update idl, xcompose (diff) | |
| download | nvim-treesitter-3e535e826da265748b875b18dbfb361bd1a1701c.tar nvim-treesitter-3e535e826da265748b875b18dbfb361bd1a1701c.tar.gz nvim-treesitter-3e535e826da265748b875b18dbfb361bd1a1701c.tar.bz2 nvim-treesitter-3e535e826da265748b875b18dbfb361bd1a1701c.tar.lz nvim-treesitter-3e535e826da265748b875b18dbfb361bd1a1701c.tar.xz nvim-treesitter-3e535e826da265748b875b18dbfb361bd1a1701c.tar.zst nvim-treesitter-3e535e826da265748b875b18dbfb361bd1a1701c.zip | |
fix(r): adapt indent queries
- Anchor parameter query. There's no need for multiple indent.align
captures
- Narrow down binary_operator indent.begin. From tree-sitter-r corpus
and highlight tests, this seems to be appropriate.
Diffstat (limited to 'tests/indent')
| -rw-r--r-- | tests/indent/r_spec.lua | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/indent/r_spec.lua b/tests/indent/r_spec.lua index dc3fe9b8c..60271b6a7 100644 --- a/tests/indent/r_spec.lua +++ b/tests/indent/r_spec.lua @@ -10,9 +10,7 @@ local run = Runner:new(it, "tests/indent/r", { describe("indent R:", function() describe("whole file:", function() - run:whole_file(".", { - expected_failures = { "./pipe.R" }, - }) + run:whole_file(".", {}) end) describe("new line:", function() @@ -34,9 +32,8 @@ describe("indent R:", function() run:new_line("loop.R", { on_line = 8, text = "x <- x + 1", indent = 2 }) run:new_line("loop.R", { on_line = 14, text = "print('lol')", indent = 4 }) - -- FIXME: |>, %>% indent broken after parser update - -- run:new_line("pipe.R", { on_line = 1, text = "head(n = 10L) |>", indent = 2 }) - -- run:new_line("pipe.R", { on_line = 9, text = "head()", indent = 2 }) + run:new_line("pipe.R", { on_line = 1, text = "head(n = 10L) |>", indent = 2 }) + run:new_line("pipe.R", { on_line = 9, text = "head()", indent = 2 }) run:new_line("aligned_indent.R", { on_line = 1, text = "z,", indent = 17 }) end) |
