diff options
Diffstat (limited to 'tests/query/highlights/python')
| -rw-r--r-- | tests/query/highlights/python/decorators.py | 22 | ||||
| -rw-r--r-- | tests/query/highlights/python/functions.py | 13 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/query/highlights/python/decorators.py b/tests/query/highlights/python/decorators.py new file mode 100644 index 000000000..278e4e311 --- /dev/null +++ b/tests/query/highlights/python/decorators.py @@ -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 + diff --git a/tests/query/highlights/python/functions.py b/tests/query/highlights/python/functions.py new file mode 100644 index 000000000..6d3028433 --- /dev/null +++ b/tests/query/highlights/python/functions.py @@ -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 |
