Skip to content

Commit 215c973

Browse files
committed
feat(ocaml): Add OCaml queries
1 parent ad8f0a4 commit 215c973

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

queries/ocaml/textobjects.scm

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
(value_definition
2+
(let_binding
3+
body: (_) @function.inner)) @function.outer
4+
5+
(method_definition
6+
body: (_) @function.inner) @function.outer
7+
8+
(class_definition
9+
(class_binding
10+
body: (_) @class.inner)) @class.outer
11+
12+
(for_expression
13+
(do_clause
14+
(_) @loop.inner)) @loop.outer
15+
16+
(while_expression
17+
(do_clause
18+
(_) @loop.inner)) @loop.outer
19+
20+
(if_expression
21+
condition: (_)
22+
(then_clause
23+
(_) @conditional.inner)
24+
(else_clause
25+
(_) @conditional.inner)) @conditional.outer
26+
27+
(if_expression
28+
condition: (_)
29+
(then_clause
30+
(_) @conditional.inner)) @conditional.outer
31+
32+
(function_expression
33+
(match_case) @_start @_end
34+
(match_case)* @_end
35+
(#make-range! "conditional.inner" @_start @_end)) @conditional.outer
36+
37+
(match_expression
38+
(match_case) @_start @_end
39+
(match_case)* @_end
40+
(#make-range! "conditional.inner" @_start @_end)) @conditional.outer
41+
42+
(comment) @comment.outer
43+
44+
(parameter) @parameter.outer
45+
46+
(application_expression
47+
argument: (_) @parameter.outer) @call.outer
48+
49+
(application_expression
50+
argument: (_) @_start @_end
51+
argument: (_)* @_end
52+
(#make-range! "call.inner" @_start @_end))
53+
54+
(parenthesized_expression
55+
(_) @_start @_end
56+
(_)? @_end
57+
(#make-range! "block.inner" @_start @_end)) @block.outer

0 commit comments

Comments
 (0)