aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--queries/python/highlights.scm6
-rw-r--r--queries/starlark/highlights.scm2
-rw-r--r--tests/query/highlights/python/fields.py10
3 files changed, 14 insertions, 4 deletions
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