Python highlights: highlight functions with self as methods (#198)

Also highlight __init__/__new__ as constructor
This commit is contained in:
Stephan Seitz 2020-07-18 19:50:45 +02:00 committed by Thomas Vigouroux
parent 58c6d2a73f
commit 969edeeced

View file

@ -48,6 +48,19 @@
(function_definition
name: (identifier) @function)
((function_definition
name: (identifier) @method
parameters: (parameters
(identifier) @self) )
(eq? @self "self"))
((function_definition
name: (identifier) @constructor
parameters: (parameters
(identifier) @self) )
(eq? @self "self")
(match? @constructor "(__new__|__init__)"))
(type (identifier) @type)
(type
(subscript