diff options
| -rw-r--r-- | queries/php_only/highlights.scm | 14 | ||||
| -rw-r--r-- | tests/query/highlights/php/types.php | 2 | ||||
| -rw-r--r-- | tests/query/highlights/php/variables.php | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/queries/php_only/highlights.scm b/queries/php_only/highlights.scm index e97b49a91..3d88567e6 100644 --- a/queries/php_only/highlights.scm +++ b/queries/php_only/highlights.scm @@ -317,10 +317,12 @@ ]) ; Parameters -[ - (simple_parameter) - (variadic_parameter) -] @variable.parameter +(variadic_parameter + "..." @operator + name: (variable_name) @variable.parameter) + +(simple_parameter + name: (variable_name) @variable.parameter) (argument (name) @variable.parameter) @@ -362,7 +364,9 @@ (attribute_list) @attribute ; Conditions ( ? : ) -(conditional_expression) @keyword.conditional +(conditional_expression + "?" @keyword.conditional.ternary + ":" @keyword.conditional.ternary) ; Directives (declare_directive diff --git a/tests/query/highlights/php/types.php b/tests/query/highlights/php/types.php index 5985d6361..67a1c2f43 100644 --- a/tests/query/highlights/php/types.php +++ b/tests/query/highlights/php/types.php @@ -2,7 +2,7 @@ function b(int $a, string $b): Foo\Dog {} // ^^^ @type.builtin -// ^^ @variable +// ^^ @variable.parameter // ^^^^^^ @type.builtin // ^^^ @module // ^^^ @type diff --git a/tests/query/highlights/php/variables.php b/tests/query/highlights/php/variables.php index a9c099ff2..f6477e131 100644 --- a/tests/query/highlights/php/variables.php +++ b/tests/query/highlights/php/variables.php @@ -2,7 +2,7 @@ class A { public function foo(self $a): self { -// ^ @variable +// ^ @variable.parameter new self(); // ^^^^ @constructor new static(); |
