diff options
| author | Ryan Barth <ryan@barth.tech> | 2022-06-11 18:58:46 -0700 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-06-14 22:35:14 +0200 |
| commit | e6ff4c80849a951c976511abe28c52ae24dd89e3 (patch) | |
| tree | 8a7bffe2a195e1875c7333ce2f5783f3b270056c /queries/python | |
| parent | fix(tiger): remove duplicate keywords (diff) | |
| download | nvim-treesitter-e6ff4c80849a951c976511abe28c52ae24dd89e3.tar nvim-treesitter-e6ff4c80849a951c976511abe28c52ae24dd89e3.tar.gz nvim-treesitter-e6ff4c80849a951c976511abe28c52ae24dd89e3.tar.bz2 nvim-treesitter-e6ff4c80849a951c976511abe28c52ae24dd89e3.tar.lz nvim-treesitter-e6ff4c80849a951c976511abe28c52ae24dd89e3.tar.xz nvim-treesitter-e6ff4c80849a951c976511abe28c52ae24dd89e3.tar.zst nvim-treesitter-e6ff4c80849a951c976511abe28c52ae24dd89e3.zip | |
fix: keep cls variable highlighting consistent in class methods
Diffstat (limited to 'queries/python')
| -rw-r--r-- | queries/python/highlights.scm | 12 |
1 files changed, 2 insertions, 10 deletions
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 |
