Skip to content

Commit 6fd7142

Browse files
committed
add variadic first params to param treesitter query
1 parent 137a2e6 commit 6fd7142

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

home/nvim/go-textobjects.scm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@
1313
; custom go type (@class includes literals?!)
1414
(type_declaration) @customtype.outer
1515

16+
; add variadic_parameter_declaration
17+
(parameter_list
18+
.
19+
(variadic_parameter_declaration) @parameter.inner
20+
.
21+
","? @_end
22+
(#make-range! "parameter.outer" @parameter.inner @_end))
23+
1624
; peeking should show the body of functions and types
1725
[ (type_declaration) (function_declaration) (method_declaration) ] @peek
1826

1927
; custom go type bodies without curlies
2028
(type_declaration
21-
(type_spec
29+
(type_spec
2230
name: (type_identifier)
2331
type: [
2432
(struct_type (field_declaration_list . "{" . (_) @_start @_end (_)? @_end . "}"))

0 commit comments

Comments
 (0)