diff options
| -rw-r--r-- | queries/php_only/highlights.scm | 22 | ||||
| -rw-r--r-- | tests/query/highlights/php/keywords.php | 12 |
2 files changed, 34 insertions, 0 deletions
diff --git a/queries/php_only/highlights.scm b/queries/php_only/highlights.scm index 790bd088f..6d51154df 100644 --- a/queries/php_only/highlights.scm +++ b/queries/php_only/highlights.scm @@ -233,6 +233,17 @@ alias: (name) @function ]) +(namespace_use_declaration + type: "function" + body: (namespace_use_group + (namespace_use_clause + [ + (name) @function + (qualified_name + (name) @function) + alias: (name) @function + ]))) + (namespace_use_clause type: "const" [ @@ -242,6 +253,17 @@ alias: (name) @constant ]) +(namespace_use_declaration + type: "const" + body: (namespace_use_group + (namespace_use_clause + [ + (name) @constant + (qualified_name + (name) @constant) + alias: (name) @constant + ]))) + (class_interface_clause [ (name) @type diff --git a/tests/query/highlights/php/keywords.php b/tests/query/highlights/php/keywords.php index 6b938c43f..5504cab19 100644 --- a/tests/query/highlights/php/keywords.php +++ b/tests/query/highlights/php/keywords.php @@ -12,16 +12,28 @@ use Foo\Baz as Baaz; // ^^ @keyword.operator // ^^^^ @type.definition +use Foo\Baz\{Foo, Bar}; +// ^^^ @type +// ^^^ @type + use function Foo\foo as fooo; // ^^^^^^^^ @keyword.function // ^^^ @function // ^^^^ @function +use function Foo\{bar, baz}; +// ^^^ @function +// ^^^ @function + use const Foo\FOO as FOOO; // ^^^^^ @keyword.modifier // ^^^ @constant // ^^^^ @constant +use const Foo\{FOO, BAR}; +// ^^^ @constant +// ^^^ @constant + use Foo\Baz\{ // ^^^ @module // ^^^ @module |
