From 5508832ba6420adc39b31ffee0f9de292eca6d13 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 18 Oct 2024 11:25:03 -0400 Subject: [PATCH] svelte: Adjust block keyword highlighting (#19418) This PR adjusts the highlights for `{#each ...}` and `{#if ...}` expression blocks to use keyword highlighting. Extracted from https://github.com/zed-industries/zed/pull/18052. Release Notes: - N/A Co-authored-by: Albert Marashi --- extensions/svelte/languages/svelte/highlights.scm | 9 +++++---- extensions/svelte/languages/svelte/injections.scm | 8 +++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/extensions/svelte/languages/svelte/highlights.scm b/extensions/svelte/languages/svelte/highlights.scm index 01d8bb8db6..cd3a08921e 100755 --- a/extensions/svelte/languages/svelte/highlights.scm +++ b/extensions/svelte/languages/svelte/highlights.scm @@ -20,6 +20,7 @@ ) ) +; Style self-closing component attributes as @tag.property (self_closing_tag ( (tag_name) @_tag_name @@ -77,19 +78,19 @@ ; Treating (if, each, ...) as a keyword inside of blocks ; like {#if ...} or {#each ...} (block_start_tag - tag: _ @tag.keyword + tag: _ @keyword ) (block_tag - tag: _ @tag.keyword + tag: _ @keyword ) (block_end_tag - tag: _ @tag.keyword + tag: _ @keyword ) (expression_tag - tag: _ @tag.keyword + tag: _ @keyword ) ; Style quoted string attribute values diff --git a/extensions/svelte/languages/svelte/injections.scm b/extensions/svelte/languages/svelte/injections.scm index 73d2b9abb1..c3b7f088d6 100755 --- a/extensions/svelte/languages/svelte/injections.scm +++ b/extensions/svelte/languages/svelte/injections.scm @@ -55,7 +55,7 @@ (#set! "language" "ts") ) -; Match style tags with a lang attribute +; Match