Skip to content

Commit

Permalink
extend rust @parameter textobjects
Browse files Browse the repository at this point in the history
  • Loading branch information
IndianBoy42 authored and theHamsta committed Jul 20, 2021
1 parent 7542261 commit c381eee
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions queries/rust/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,18 @@

;; parameter

(("," @_start . (parameter) @parameter.inner)
((parameters
"," @_start . (parameter) @parameter.inner)
(#make-range! "parameter.outer" @_start @parameter.inner))
((parameters . (parameter) @parameter.inner . ","? @_end)
((parameters
. (parameter) @parameter.inner . ","? @_end)
(#make-range! "parameter.outer" @parameter.inner @_end))

((type_parameters
"," @_start . (_) @parameter.inner)
(#make-range! "parameter.outer" @_start @parameter.inner))
((type_parameters
. (_) @parameter.inner . ","? @_end)
(#make-range! "parameter.outer" @parameter.inner @_end))

((tuple_pattern
Expand Down Expand Up @@ -108,6 +117,13 @@
. (_) @parameter.inner . ","? @_end)
(#make-range! "parameter.outer" @parameter.inner @_end))

((type_arguments
"," @_start . (_) @parameter.inner)
(#make-range! "parameter.outer" @_start @parameter.inner))
((type_arguments
. (_) @parameter.inner . ","? @_end)
(#make-range! "parameter.outer" @parameter.inner @_end))

((meta_arguments
"," @_start . (_) @parameter.inner)
(#make-range! "parameter.outer" @_start @parameter.inner))
Expand Down

0 comments on commit c381eee

Please sign in to comment.