diff --git a/queries/php/textobjects.scm b/queries/php/textobjects.scm index a14034d4..7406e167 100644 --- a/queries/php/textobjects.scm +++ b/queries/php/textobjects.scm @@ -23,8 +23,20 @@ (_ (switch_block) @block.inner) @block.outer ;; parameters -(formal_parameters - (simple_parameter) @parameter.inner) - (arguments - (argument) @parameter.inner) + "," @_start . + (_) @parameter.inner + (#make-range! "parameter.outer" @_start @parameter.inner)) +(arguments + . (_) @parameter.inner + . ","? @_end + (#make-range! "parameter.outer" @parameter.inner @_end)) + +(formal_parameters + "," @_start . + (_) @parameter.inner + (#make-range! "parameter.outer" @_start @parameter.inner)) +(formal_parameters + . (_) @parameter.inner + . ","? @_end + (#make-range! "parameter.outer" @parameter.inner @_end))