mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 12:50:09 -04:00
fix(python): don't highlight attribute name as builtin
This commit is contained in:
parent
71ac531a63
commit
457195a886
1 changed files with 6 additions and 2 deletions
|
|
@ -408,12 +408,15 @@
|
|||
superclasses: (argument_list
|
||||
(identifier) @type))
|
||||
|
||||
; Assign higher priority to @variable.member than @type.builtin
|
||||
; Otherwise reserved builtins (such as `type`) are valid as attribute name
|
||||
((class_definition
|
||||
body: (block
|
||||
(expression_statement
|
||||
(assignment
|
||||
left: (identifier) @variable.member))))
|
||||
(#lua-match? @variable.member "^[%l_].*$"))
|
||||
(#lua-match? @variable.member "^[%l_].*$")
|
||||
(#set! "priority" 101))
|
||||
|
||||
((class_definition
|
||||
body: (block
|
||||
|
|
@ -421,7 +424,8 @@
|
|||
(assignment
|
||||
left: (_
|
||||
(identifier) @variable.member)))))
|
||||
(#lua-match? @variable.member "^[%l_].*$"))
|
||||
(#lua-match? @variable.member "^[%l_].*$")
|
||||
(#set! "priority" 101))
|
||||
|
||||
((class_definition
|
||||
(block
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue