diff --git a/queries/lua/textobjects.scm b/queries/lua/textobjects.scm index 1c1ca1d6..aa2c5554 100644 --- a/queries/lua/textobjects.scm +++ b/queries/lua/textobjects.scm @@ -76,9 +76,13 @@ (#make-range! "parameter.outer" @parameter.inner @_end)) (table_constructor - (field) @parameter.inner - ","? @_end - (#make-range! "parameter.outer" @parameter.inner @_end)) + . (field) @parameter.inner . ","? @_outer_end + (#make-range! "parameter.outer" @parameter.inner @_outer_end)) + +(table_constructor + . (_) @_start . (_)* @_inner_end . ","? @_outer_end + (#make-range! "parameter.inner" @_start @_inner_end) + (#make-range! "parameter.outer" @_start @_outer_end)) (arguments "," @_start @@ -90,6 +94,15 @@ . (_) @parameter.inner (#make-range! "parameter.outer" @_start @parameter.inner)) +(table_constructor + "," @_outer_start . (field) @parameter.inner . ","? + (#make-range! "parameter.outer" @_outer_start @parameter.inner)) + +(table_constructor + "," @_outer_start . (_) @_inner_start . (_)* @_end . ","? + (#make-range! "parameter.inner" @_inner_start @_end) + (#make-range! "parameter.outer" @_outer_start @_end)) + ; number (number) @number.inner