Skip to content

Commit 7c9a5ad

Browse files
fix(zig): wrap parentheses patterns in arguments node for call_expression
The parser structure has parentheses as children of the arguments field within call_expression, not as direct children of call_expression itself. This update correctly wraps the parentheses and their contents within the arguments node. Fixes: #813
1 parent a9742cb commit 7c9a5ad

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

queries/zig/textobjects.scm

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,23 @@
7070
; arguments
7171
(call_expression
7272
function: (_)
73-
"("
74-
"," @_start
75-
.
76-
(_) @parameter.inner
77-
")"
73+
arguments: (arguments
74+
"("
75+
"," @_start
76+
.
77+
(_) @parameter.inner
78+
")")
7879
(#make-range! "parameter.outer" @_start @parameter.inner))
7980

8081
(call_expression
8182
function: (_)
82-
"("
83-
.
84-
(_) @parameter.inner
85-
.
86-
","? @_end
87-
")"
83+
arguments: (arguments
84+
"("
85+
.
86+
(_) @parameter.inner
87+
.
88+
","? @_end
89+
")")
8890
(#make-range! "parameter.outer" @parameter.inner @_end))
8991

9092
; comments
@@ -122,10 +124,11 @@
122124
(call_expression) @call.outer
123125

124126
(call_expression
125-
"("
126-
.
127-
_ @_start
128-
_? @_end
129-
.
130-
")"
127+
arguments: (arguments
128+
"("
129+
.
130+
_ @_start
131+
_? @_end
132+
.
133+
")")
131134
(#make-range! "call.inner" @_start @_end))

0 commit comments

Comments
 (0)