fix(python): highlight function calls correctly (#7728)

This commit is contained in:
Salomon Popp 2025-03-12 09:22:33 +01:00 committed by GitHub
parent db8689da4a
commit 1a314a58d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 77 additions and 42 deletions

View file

@ -0,0 +1,22 @@
from dataclasses import dataclass
@dataclass
#^^^^^^^^^ @attribute
class Data:
_foo: str
@property
# ^ @attribute
# ^^^^^^^^ @attribute.builtin
def foo(self) -> str:
return self._foo
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
#^^^^^^ @variable
# ^^^^ @variable.member
# ^^^^^^^^^^^^^^ @attribute
def test_func():
pass

View file

@ -0,0 +1,13 @@
def func() -> None: ...
_ = func()
# ^^^^ @function.call
"{}".format(1)
# ^^^^^^ @function.method.call
class Foo:
def method(self) -> None: ...
Foo().method()
# ^^^^^^ @function.method.call