mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(python,starlark): update field match pattern
This commit is contained in:
parent
39f5d8d89e
commit
5ab25d8a1f
3 changed files with 14 additions and 4 deletions
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
((attribute
|
||||
attribute: (identifier) @field)
|
||||
(#lua-match? @field "^%u@!.*$"))
|
||||
(#lua-match? @field "^.*%l.*$"))
|
||||
|
||||
((identifier) @type.builtin
|
||||
(#any-of? @type.builtin
|
||||
|
|
@ -324,14 +324,14 @@
|
|||
(expression_statement
|
||||
(assignment
|
||||
left: (identifier) @field))))
|
||||
(#lua-match? @field "^%u@!.*$"))
|
||||
(#lua-match? @field "^%l.*$"))
|
||||
((class_definition
|
||||
body: (block
|
||||
(expression_statement
|
||||
(assignment
|
||||
left: (_
|
||||
(identifier) @field)))))
|
||||
(#lua-match? @field "^%u@!.*$"))
|
||||
(#lua-match? @field "^%l.*$"))
|
||||
|
||||
((class_definition
|
||||
(block
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
((attribute
|
||||
attribute: (identifier) @field)
|
||||
(#lua-match? @field "^%u@!.*$"))
|
||||
(#lua-match? @field "^.*%l.*$"))
|
||||
|
||||
((identifier) @type.builtin
|
||||
(#any-of? @type.builtin
|
||||
|
|
|
|||
10
tests/query/highlights/python/fields.py
Normal file
10
tests/query/highlights/python/fields.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class Fields:
|
||||
def __init__(self, fields):
|
||||
self.fields = fields
|
||||
# ^^^^^^ @field
|
||||
self.__dunderfield__ = None
|
||||
# ^^^^^^^^^^^^^^^ @field
|
||||
self._FunKyFielD = 0
|
||||
# ^^^^^^^^^^^ @field
|
||||
self.NOT_A_FIELD = "IM NOT A FIELD"
|
||||
# ^^^^^^^^^^^ @constant
|
||||
Loading…
Add table
Add a link
Reference in a new issue