From 01b42a1a57b020f18c2bf73fb545a3a7833166c9 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Mon, 24 Apr 2023 00:30:18 -0400 Subject: [PATCH] feat(python,starlark): highlight type conversions as `@function.macro` --- queries/python/highlights.scm | 2 ++ queries/starlark/highlights.scm | 2 ++ tests/query/highlights/python/pattern_matching.py | 1 + 3 files changed, 5 insertions(+) diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 5496263f0..6e9436ff1 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -304,6 +304,8 @@ "{" @punctuation.special "}" @punctuation.special) +(type_conversion) @function.macro + ["," "." ":" ";" (ellipsis)] @punctuation.delimiter ;; Class definitions diff --git a/queries/starlark/highlights.scm b/queries/starlark/highlights.scm index ad2ecb89d..b203bc9d6 100644 --- a/queries/starlark/highlights.scm +++ b/queries/starlark/highlights.scm @@ -259,6 +259,8 @@ "{" @punctuation.special "}" @punctuation.special) +(type_conversion) @function.macro + ["," "." ":" ";" (ellipsis)] @punctuation.delimiter ;; Error diff --git a/tests/query/highlights/python/pattern_matching.py b/tests/query/highlights/python/pattern_matching.py index 38622cf4b..2d7d7d0c0 100644 --- a/tests/query/highlights/python/pattern_matching.py +++ b/tests/query/highlights/python/pattern_matching.py @@ -29,6 +29,7 @@ match command.split(): case ["drop", *objects]: pass case _: print(f"Sorry, I couldn't understand {command!r}") + # ^^ @function.macro match command.split(): # ^ conditional