mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-08 22:40:12 -04:00
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.
This commit is contained in:
parent
c11d49cbef
commit
3e535e826d
2 changed files with 6 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue