indents(r): add indents support

This commit is contained in:
Pedro Castro 2022-01-27 12:14:18 -03:00 committed by Stephan Seitz
parent 3f876efce5
commit 807b20d0de

36
queries/r/indents.scm Normal file
View file

@ -0,0 +1,36 @@
[
(call)
(brace_list)
(function_definition (brace_list))
(paren_list)
(special)
"|>"
"if"
"else"
"while"
"repeat"
"for"
] @indent
[
"}"
")"
] @branch
(pipe
(call) @aligned_indent
(#set! "delimiter" "()"))
((special)
(call) @aligned_indent
(#set! "delimiter" "()"))
[
")"
"}"
] @indent_end
[
(comment)
] @ignore