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 b5c64e96344cfbdeaa6dfe35a8bdca99b6c891e5..12bde13e5184e17e7fa4d720e4b1b085191eee5f 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 93011b1f10738f1260aa7d878e4bc598f9e4cf0b..f2ff2e8ed3cf816d33f21a3c4c0ba3e96b516fd9 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 9c413f0041b7eee9f3b24353478eb7ab5151ed43..72694b1adf5f5a8444cda548471594df93c231b3 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)