fix(python): don't highlight attribute name as builtin (#7712)

* fix(python): don't highlight attribute name as builtin

* fix(python): highlight `@variable.member` correctly for member access context

* test: add test

* test: expand test

* docs: update comment

* refactor: change order, remove priority override

* style: remove extra newline
This commit is contained in:
Salomon Popp 2025-03-11 08:48:33 +01:00 committed by GitHub
parent 833405d5a9
commit cf0eabc16c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 24 deletions

View file

@ -1,9 +1,14 @@
class Fields:
type: str
# ^^^^ @variable.member
def __init__(self, fields: list[int]) -> None:
# ^^^ @type.builtin
# ^^^^ @constant.builtin
self.fields = fields
# ^^^^^^ @variable.member
self.type = "foo"
# ^^^^ @variable.member
self.__dunderfield__ = None
# ^^^^^^^^^^^^^^^ @variable.member
self._FunKyFielD = 0