From e6ff4c80849a951c976511abe28c52ae24dd89e3 Mon Sep 17 00:00:00 2001 From: Ryan Barth Date: Sat, 11 Jun 2022 18:58:46 -0700 Subject: fix: keep cls variable highlighting consistent in class methods --- queries/python/highlights.scm | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'queries/python/highlights.scm') diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 18ed5162f..780e2a5c0 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -134,6 +134,8 @@ [(true) (false)] @boolean ((identifier) @variable.builtin (#eq? @variable.builtin "self")) +((identifier) @variable.builtin + (#eq? @variable.builtin "cls")) (integer) @number (float) @float @@ -288,15 +290,5 @@ name: (identifier) @constructor))) (#any-of? @constructor "__new__" "__init__")) -; First parameter of a classmethod is cls. -((class_definition - body: (block - (decorated_definition - (decorator (identifier) @_decorator) - definition: (function_definition - parameters: (parameters . (identifier) @variable.builtin))))) - (#eq? @variable.builtin "cls") - (#eq? @_decorator "classmethod")) - ;; Error (ERROR) @error -- cgit v1.2.3-70-g09d2