Skip to content

Commit

Permalink
feat(toml): Add @parameter.inner and @parameter.outer (#561)
Browse files Browse the repository at this point in the history
Includes array elements, key-val pair in inline tables and key-val pairs
in normal tables.
  • Loading branch information
crazymerlyn authored Feb 8, 2024
1 parent 8edd5a6 commit a05979b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions queries/toml/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,31 @@
(integer)
(float)
] @number.inner

((table
(pair) @parameter.inner @parameter.outer
))

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

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

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

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

0 comments on commit a05979b

Please sign in to comment.