aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index c1e6bf1d7..52dbb6169 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -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