From 91dc01d82e40451a2342915ce581cbd506cb2a4a Mon Sep 17 00:00:00 2001 From: disrupted Date: Tue, 11 Mar 2025 22:47:55 +0100 Subject: [PATCH] fix: adjust highlight order --- queries/python/highlights.scm | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index f3824a553..60f3e14c0 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -35,31 +35,6 @@ function: (identifier) @_func)) (#any-of? @_func "TypeVar" "NewType")) -; Decorators -((decorator - "@" @attribute) - (#set! priority 101)) - -(decorator - (identifier) @attribute) - -(decorator - (attribute - attribute: (identifier) @attribute)) - -(decorator - (call - (identifier) @attribute)) - -(decorator - (call - (attribute - attribute: (identifier) @attribute))) - -((decorator - (identifier) @attribute.builtin) - (#any-of? @attribute.builtin "classmethod" "property" "staticmethod")) - ; Builtin functions ((call function: (identifier) @function.builtin) @@ -459,3 +434,28 @@ (string (string_content) @string.regexp)) (#eq? @_re "re")) + +; Decorators +((decorator + "@" @attribute) + (#set! priority 101)) + +(decorator + (identifier) @attribute) + +(decorator + (attribute + attribute: (identifier) @attribute)) + +(decorator + (call + (identifier) @attribute)) + +(decorator + (call + (attribute + attribute: (identifier) @attribute))) + +((decorator + (identifier) @attribute.builtin) + (#any-of? @attribute.builtin "classmethod" "property" "staticmethod"))