Skip to content

Commit 71385f1

Browse files
authored
feat(java): add @return.inner & @return.outer text objects (#788)
The query handles methods with a typical return as you'd expect: ```java class Example { private String example() { return "example"; } } ``` I made the wildcard child node optional `(_)?` in the query so `@return.outer` matches `void` returns: ```java class Example { private void example() { return; } } ```
1 parent 89ebe73 commit 71385f1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

queries/java/textobjects.scm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
"}"
2828
(#make-range! "function.inner" @_start @_end)))
2929

30+
(return_statement
31+
(_)? @return.inner) @return.outer
32+
3033
(for_statement
3134
body: (_)? @loop.inner) @loop.outer
3235

0 commit comments

Comments
 (0)