diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-04 23:36:07 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-05 18:54:55 +0100 |
| commit | ca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8 (patch) | |
| tree | bb42ca9fbd291835c3837f8ee6d1b7e148b6bad1 | |
| parent | indents(go): perform some changes as go fmt dictates (diff) | |
| download | nvim-treesitter-ca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8.tar nvim-treesitter-ca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8.tar.gz nvim-treesitter-ca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8.tar.bz2 nvim-treesitter-ca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8.tar.lz nvim-treesitter-ca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8.tar.xz nvim-treesitter-ca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8.tar.zst nvim-treesitter-ca06ff0a61bc521f8ad3a2a280ba2e6f1b10f4c8.zip | |
indents(r): fix all R tests
| -rw-r--r-- | queries/r/indents.scm | 9 | ||||
| -rw-r--r-- | tests/indent/r_spec.lua | 5 |
2 files changed, 4 insertions, 10 deletions
diff --git a/queries/r/indents.scm b/queries/r/indents.scm index e601fafc4..e95d2338c 100644 --- a/queries/r/indents.scm +++ b/queries/r/indents.scm @@ -1,8 +1,8 @@ [ - (call) (brace_list) (paren_list) (special) + (pipe) "|>" "if" "else" @@ -17,12 +17,7 @@ ] @branch -(pipe - (call) @aligned_indent - (#set! "delimiter" "()")) - -((special) - (call) @aligned_indent +((call) @aligned_indent (#set! "delimiter" "()")) ((formal_parameters (identifier)) @aligned_indent diff --git a/tests/indent/r_spec.lua b/tests/indent/r_spec.lua index 20454df7c..d7f6b07dc 100644 --- a/tests/indent/r_spec.lua +++ b/tests/indent/r_spec.lua @@ -1,5 +1,5 @@ local Runner = require("tests.indent.common").Runner -local XFAIL = require("tests.indent.common").XFAIL +--local XFAIL = require("tests.indent.common").XFAIL local run = Runner:new(it, "tests/indent/r", { tabstop = 2, @@ -12,7 +12,6 @@ describe("indent R:", function() describe("whole file:", function() run:whole_file(".", { expected_failures = { - "r/pipe.R", }, }) end) @@ -35,7 +34,7 @@ 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 }) - run:new_line("pipe.R", { on_line = 1, text = "head(n = 10L) |>", indent = 2 }, "expected failure", XFAIL) + run:new_line("pipe.R", { on_line = 1, text = "head(n = 10L) |>", indent = 2 }) run:new_line("aligned_indent.R", { on_line = 1, text = "z,", indent = 17 }) end) |
