From 5ab25d8a1f759d6d0a825acc653f2d1c2679e0df Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Fri, 21 Apr 2023 20:45:47 -0400 Subject: fix(python,starlark): update field match pattern --- queries/python/highlights.scm | 6 +++--- queries/starlark/highlights.scm | 2 +- tests/query/highlights/python/fields.py | 10 ++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 tests/query/highlights/python/fields.py diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 30747b1fa..5496263f0 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -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 diff --git a/queries/starlark/highlights.scm b/queries/starlark/highlights.scm index f318258ac..ad2ecb89d 100644 --- a/queries/starlark/highlights.scm +++ b/queries/starlark/highlights.scm @@ -29,7 +29,7 @@ ((attribute attribute: (identifier) @field) - (#lua-match? @field "^%u@!.*$")) + (#lua-match? @field "^.*%l.*$")) ((identifier) @type.builtin (#any-of? @type.builtin diff --git a/tests/query/highlights/python/fields.py b/tests/query/highlights/python/fields.py new file mode 100644 index 000000000..21b6251dc --- /dev/null +++ b/tests/query/highlights/python/fields.py @@ -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 -- cgit v1.2.3-70-g09d2