From 99600641de75419f7729698acf9dc3d79117ff70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 4 Jan 2022 20:21:17 +0100 Subject: [PATCH] Add support for parameter.outer for PHP --- queries/php/textobjects.scm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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))