From ee260910cd9ee79355383fe2968e3ec7614cdb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Pf=C3=A4ffle?= <67913738+rpfaeffle@users.noreply.github.com> Date: Fri, 15 Mar 2024 03:58:17 +0100 Subject: [PATCH] Improve TS and JSON syntax highlighting (#9302) Successor to #7767. Release Notes: - Improved syntax highlighting for TS/TSX and JSON. --- crates/languages/src/json/highlights.scm | 2 +- crates/languages/src/tsx/highlights.scm | 6 ++++++ crates/languages/src/typescript/highlights.scm | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/languages/src/json/highlights.scm b/crates/languages/src/json/highlights.scm index b5c64e9634..12bde13e51 100644 --- a/crates/languages/src/json/highlights.scm +++ b/crates/languages/src/json/highlights.scm @@ -3,7 +3,7 @@ (string) @string (pair - key: (string) @property) + key: (string) @property.json_key) (number) @number diff --git a/crates/languages/src/tsx/highlights.scm b/crates/languages/src/tsx/highlights.scm index 93011b1f10..f2ff2e8ed3 100644 --- a/crates/languages/src/tsx/highlights.scm +++ b/crates/languages/src/tsx/highlights.scm @@ -78,6 +78,7 @@ [ (string) (template_string) + (template_literal_type) ] @string (escape_sequence) @string.escape @@ -93,6 +94,7 @@ "." "," ":" + "?" ] @punctuation.delimiter [ @@ -200,6 +202,10 @@ "${" @punctuation.special "}" @punctuation.special) @embedded +(template_type + "${" @punctuation.special + "}" @punctuation.special) @embedded + (type_arguments "<" @punctuation.bracket ">" @punctuation.bracket) diff --git a/crates/languages/src/typescript/highlights.scm b/crates/languages/src/typescript/highlights.scm index 9c413f0041..72694b1adf 100644 --- a/crates/languages/src/typescript/highlights.scm +++ b/crates/languages/src/typescript/highlights.scm @@ -78,6 +78,7 @@ [ (string) (template_string) + (template_literal_type) ] @string (escape_sequence) @string.escape @@ -93,6 +94,7 @@ "." "," ":" + "?" ] @punctuation.delimiter [ @@ -200,6 +202,10 @@ "${" @punctuation.special "}" @punctuation.special) @embedded +(template_type + "${" @punctuation.special + "}" @punctuation.special) @embedded + (type_arguments "<" @punctuation.bracket ">" @punctuation.bracket)