mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 17:30:08 -04:00
highlights(php): detect constructor calls on instantiation
This commit is contained in:
parent
976659761d
commit
723d91e821
1 changed files with 7 additions and 5 deletions
|
|
@ -28,7 +28,7 @@
|
||||||
. [(name) (qualified_name)] @type
|
. [(name) (qualified_name)] @type
|
||||||
(name) @constant)
|
(name) @constant)
|
||||||
|
|
||||||
; Functions
|
; Functions, methods, constructors
|
||||||
|
|
||||||
(array_creation_expression "array" @function.builtin)
|
(array_creation_expression "array" @function.builtin)
|
||||||
(list_literal "list" @function.builtin)
|
(list_literal "list" @function.builtin)
|
||||||
|
|
@ -54,6 +54,12 @@
|
||||||
(nullsafe_member_call_expression
|
(nullsafe_member_call_expression
|
||||||
name: (name) @method)
|
name: (name) @method)
|
||||||
|
|
||||||
|
(method_declaration
|
||||||
|
name: (name) @constructor
|
||||||
|
(#eq? @constructor "__construct"))
|
||||||
|
(object_creation_expression
|
||||||
|
[(name) (qualified_name)] @constructor)
|
||||||
|
|
||||||
; Parameters
|
; Parameters
|
||||||
[
|
[
|
||||||
(simple_parameter)
|
(simple_parameter)
|
||||||
|
|
@ -78,10 +84,6 @@
|
||||||
((name) @constant
|
((name) @constant
|
||||||
(#vim-match? @constant "^_?[A-Z][A-Z\d_]+$"))
|
(#vim-match? @constant "^_?[A-Z][A-Z\d_]+$"))
|
||||||
|
|
||||||
(method_declaration
|
|
||||||
name: (name) @constructor
|
|
||||||
(#eq? @constructor "__construct"))
|
|
||||||
|
|
||||||
(const_declaration (const_element (name) @constant))
|
(const_declaration (const_element (name) @constant))
|
||||||
|
|
||||||
((name) @variable.builtin
|
((name) @variable.builtin
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue