Skip to content

Commit

Permalink
add some r textojects
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Jul 5, 2024
1 parent d2f1835 commit 3ea02d2
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions queries/r/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
; block
; call
(call) @call.outer

(arguments) @call.inner

; class
; comment
(comment) @comment.outer

; conditional
(if_statement
condition: (_)? @conditional.inner) @conditional.outer

; function
[
(function_definition)
] @function.outer

(function_definition
[
(call)
(binary_operator)
] @function.inner) @function.outer


; loop
[
(while_statement)
(for_statement)
(repeat_statement)
] @loop.outer

(while_statement
body: (_) @loop.inner)

(repeat_statement
body: (_) @loop.inner)

(for_statement
body: (_) @loop.inner)

; statement

(program
(_) @statement.outer)

; number
(float) @number.inner

0 comments on commit 3ea02d2

Please sign in to comment.