mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
Python: fix class highlights (#1548)
This commit is contained in:
parent
f81c6a4595
commit
948fa6a260
1 changed files with 7 additions and 6 deletions
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
((attribute
|
((attribute
|
||||||
attribute: (identifier) @field)
|
attribute: (identifier) @field)
|
||||||
(#vim-match? @field "^([A-Z])@!.*$"))
|
(#match? @field "^([A-Z])@!.*$"))
|
||||||
|
|
||||||
((identifier) @type.builtin
|
((identifier) @type.builtin
|
||||||
(#any-of? @type.builtin
|
(#any-of? @type.builtin
|
||||||
|
|
@ -50,10 +50,10 @@
|
||||||
|
|
||||||
(decorator) @function
|
(decorator) @function
|
||||||
((decorator (attribute (identifier) @function))
|
((decorator (attribute (identifier) @function))
|
||||||
(#vim-match? @function "^([A-Z])@!.*$"))
|
(#match? @function "^([A-Z])@!.*$"))
|
||||||
(decorator) @function
|
(decorator) @function
|
||||||
((decorator (identifier) @function)
|
((decorator (identifier) @function)
|
||||||
(#vim-match? @function "^([A-Z])@!.*$"))
|
(#match? @function "^([A-Z])@!.*$"))
|
||||||
|
|
||||||
(call
|
(call
|
||||||
function: (identifier) @function)
|
function: (identifier) @function)
|
||||||
|
|
@ -240,8 +240,9 @@
|
||||||
|
|
||||||
;; Class definitions
|
;; Class definitions
|
||||||
|
|
||||||
|
(class_definition name: (identifier) @type)
|
||||||
|
|
||||||
(class_definition
|
(class_definition
|
||||||
name: (identifier) @type
|
|
||||||
body: (block
|
body: (block
|
||||||
(function_definition
|
(function_definition
|
||||||
name: (identifier) @method)))
|
name: (identifier) @method)))
|
||||||
|
|
@ -255,14 +256,14 @@
|
||||||
(expression_statement
|
(expression_statement
|
||||||
(assignment
|
(assignment
|
||||||
left: (identifier) @field))))
|
left: (identifier) @field))))
|
||||||
(#vim-match? @field "^([A-Z])@!.*$"))
|
(#match? @field "^([A-Z])@!.*$"))
|
||||||
((class_definition
|
((class_definition
|
||||||
body: (block
|
body: (block
|
||||||
(expression_statement
|
(expression_statement
|
||||||
(assignment
|
(assignment
|
||||||
left: (_
|
left: (_
|
||||||
(identifier) @field)))))
|
(identifier) @field)))))
|
||||||
(#vim-match? @field "^([A-Z])@!.*$"))
|
(#match? @field "^([A-Z])@!.*$"))
|
||||||
|
|
||||||
((class_definition
|
((class_definition
|
||||||
(block
|
(block
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue