aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
authorSantos Gallegos <stsewd@protonmail.com>2021-07-11 15:06:52 -0500
committerGitHub <noreply@github.com>2021-07-11 15:06:52 -0500
commit948fa6a26033ba8a18fb528d5c26db4a16317fc0 (patch)
tree3aa1f68c34e4a09ac5fa672c529591ba178b93f6 /queries/python
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-948fa6a26033ba8a18fb528d5c26db4a16317fc0.tar
nvim-treesitter-948fa6a26033ba8a18fb528d5c26db4a16317fc0.tar.gz
nvim-treesitter-948fa6a26033ba8a18fb528d5c26db4a16317fc0.tar.bz2
nvim-treesitter-948fa6a26033ba8a18fb528d5c26db4a16317fc0.tar.lz
nvim-treesitter-948fa6a26033ba8a18fb528d5c26db4a16317fc0.tar.xz
nvim-treesitter-948fa6a26033ba8a18fb528d5c26db4a16317fc0.tar.zst
nvim-treesitter-948fa6a26033ba8a18fb528d5c26db4a16317fc0.zip
Python: fix class highlights (#1548)
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 9bcfa183d..8812d663a 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -29,7 +29,7 @@
((attribute
attribute: (identifier) @field)
- (#vim-match? @field "^([A-Z])@!.*$"))
+ (#match? @field "^([A-Z])@!.*$"))
((identifier) @type.builtin
(#any-of? @type.builtin
@@ -50,10 +50,10 @@
(decorator) @function
((decorator (attribute (identifier) @function))
- (#vim-match? @function "^([A-Z])@!.*$"))
+ (#match? @function "^([A-Z])@!.*$"))
(decorator) @function
((decorator (identifier) @function)
- (#vim-match? @function "^([A-Z])@!.*$"))
+ (#match? @function "^([A-Z])@!.*$"))
(call
function: (identifier) @function)
@@ -240,8 +240,9 @@
;; Class definitions
+(class_definition name: (identifier) @type)
+
(class_definition
- name: (identifier) @type
body: (block
(function_definition
name: (identifier) @method)))
@@ -255,14 +256,14 @@
(expression_statement
(assignment
left: (identifier) @field))))
- (#vim-match? @field "^([A-Z])@!.*$"))
+ (#match? @field "^([A-Z])@!.*$"))
((class_definition
body: (block
(expression_statement
(assignment
left: (_
(identifier) @field)))))
- (#vim-match? @field "^([A-Z])@!.*$"))
+ (#match? @field "^([A-Z])@!.*$"))
((class_definition
(block