Improve TS and JSON syntax highlighting (#9302)

Robin PfΓ€ffle created

Successor to #7767.

Release Notes:

- Improved syntax highlighting for TS/TSX and JSON.

Change summary

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(-)

Detailed changes

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)

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)