From a26bf540ff928ea9f3b1b02fee78c67e09811823 Mon Sep 17 00:00:00 2001 From: Chris Dragan Date: Thu, 1 Jan 2026 18:26:54 +0100 Subject: [PATCH] fix: update highlights --- runtime/queries/kos/highlights.scm | 17 ++++++++--------- tests/query/highlights/kos/test.kos | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/runtime/queries/kos/highlights.scm b/runtime/queries/kos/highlights.scm index 3c2e20cd2..477245dfc 100644 --- a/runtime/queries/kos/highlights.scm +++ b/runtime/queries/kos/highlights.scm @@ -8,13 +8,12 @@ (property_identifier) @property -(string_literal) @string - -(string_literal_begin) @string - -(string_literal_continuation) @string - -(string_literal_end) @string +[ + (string_literal) + (string_literal_begin) + (string_literal_continuation) + (string_literal_end) +] @string [ "case" @@ -27,6 +26,8 @@ "import" @keyword.import [ + (break_statement) + (continue_statement) "for" "loop" "repeat" @@ -61,9 +62,7 @@ (line) "assert" ;"async" - (break_statement) "const" - (continue_statement) "do" "extends" (fallthrough_statement) diff --git a/tests/query/highlights/kos/test.kos b/tests/query/highlights/kos/test.kos index 202539cb5..768c9580e 100644 --- a/tests/query/highlights/kos/test.kos +++ b/tests/query/highlights/kos/test.kos @@ -99,5 +99,29 @@ fun name(arg1, # ^ number # ^ operator # ^ variable + for const elem in arg1 { + # ^ keyword.repeat + # ^ keyword + # ^ variable + # ^ keyword.repeat + # ^ variable + # ^ punctuation.bracket + if elem { + # ^ keyword.conditional + # ^ variable + # ^ punctuation.bracket + continue + # ^ keyword.repeat + } + # ^ punctuation.bracket + else { + # ^ keyword.conditional + # ^ punctuation.bracket + break + # ^ keyword.repeat + } + # ^ punctuation.bracket + } + # <- punctuation.bracket } # <- punctuation.bracket