mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
fix(php): properly highlight grouped imported functions and constants
This commit is contained in:
parent
fc687f38d4
commit
6cb4098d51
2 changed files with 34 additions and 0 deletions
|
|
@ -233,6 +233,17 @@
|
||||||
alias: (name) @function
|
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
|
(namespace_use_clause
|
||||||
type: "const"
|
type: "const"
|
||||||
[
|
[
|
||||||
|
|
@ -242,6 +253,17 @@
|
||||||
alias: (name) @constant
|
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
|
(class_interface_clause
|
||||||
[
|
[
|
||||||
(name) @type
|
(name) @type
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,28 @@ use Foo\Baz as Baaz;
|
||||||
// ^^ @keyword.operator
|
// ^^ @keyword.operator
|
||||||
// ^^^^ @type.definition
|
// ^^^^ @type.definition
|
||||||
|
|
||||||
|
use Foo\Baz\{Foo, Bar};
|
||||||
|
// ^^^ @type
|
||||||
|
// ^^^ @type
|
||||||
|
|
||||||
use function Foo\foo as fooo;
|
use function Foo\foo as fooo;
|
||||||
// ^^^^^^^^ @keyword.function
|
// ^^^^^^^^ @keyword.function
|
||||||
// ^^^ @function
|
// ^^^ @function
|
||||||
// ^^^^ @function
|
// ^^^^ @function
|
||||||
|
|
||||||
|
use function Foo\{bar, baz};
|
||||||
|
// ^^^ @function
|
||||||
|
// ^^^ @function
|
||||||
|
|
||||||
use const Foo\FOO as FOOO;
|
use const Foo\FOO as FOOO;
|
||||||
// ^^^^^ @keyword.modifier
|
// ^^^^^ @keyword.modifier
|
||||||
// ^^^ @constant
|
// ^^^ @constant
|
||||||
// ^^^^ @constant
|
// ^^^^ @constant
|
||||||
|
|
||||||
|
use const Foo\{FOO, BAR};
|
||||||
|
// ^^^ @constant
|
||||||
|
// ^^^ @constant
|
||||||
|
|
||||||
use Foo\Baz\{
|
use Foo\Baz\{
|
||||||
// ^^^ @module
|
// ^^^ @module
|
||||||
// ^^^ @module
|
// ^^^ @module
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue