From 2b2ff6c03819b94107c640451527852c9c16c70d Mon Sep 17 00:00:00 2001 From: Roman Cinis <52065414+tsinis@users.noreply.github.com> Date: Sun, 22 Mar 2026 22:52:14 +0100 Subject: [PATCH] fix: highlight `@` symbol in annotations as attribute instead of operator The `@` symbol in Dart annotations (e.g. `@override`, `@Deprecated()`) was highlighted as an operator, making it visually distinct from the annotation name which received `@attribute` styling. This made annotations appear as two separate tokens instead of a single semantic unit. - Capture `@` as `@attribute` inside annotation rules - Remove `@` from the operators block - Move annotation rules after the generic uppercase identifier pattern so `@attribute` takes precedence over `@type` for names like `Deprecated` --- languages/dart/highlights.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/languages/dart/highlights.scm b/languages/dart/highlights.scm index 5379eae..1c34991 100644 --- a/languages/dart/highlights.scm +++ b/languages/dart/highlights.scm @@ -17,11 +17,6 @@ . (argument_part))) @function -; Annotations -; -------------------- -(annotation - name: (identifier) @attribute) - ; Operators and Tokens ; -------------------- (template_substitution @@ -36,7 +31,6 @@ (escape_sequence) @string.escape [ - "@" "=>" ".." "??" @@ -114,6 +108,12 @@ ((identifier) @type (#match? @type "^_?[A-Z].*[a-z]")) +; Annotations +; -------------------- +(annotation + "@" @attribute + name: (identifier) @attribute) + ; properties (unconditional_assignable_selector (identifier) @property)