From 33f09bad60cfeb9c1ad8c93a62cce08e037ac8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=90=E7=8B=B8?= <134658521+Huliiiiii@users.noreply.github.com> Date: Sat, 16 Nov 2024 19:42:10 +0800 Subject: [PATCH] Highlight `?` and `:` in ternary expressions as operator in JavaScript, TypeScript, and TSX (#20573) Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/languages/src/javascript/highlights.scm | 7 +++++++ crates/languages/src/tsx/highlights.scm | 7 +++++++ crates/languages/src/typescript/highlights.scm | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/crates/languages/src/javascript/highlights.scm b/crates/languages/src/javascript/highlights.scm index a89375dee2a1872d21f03c169bf54f3d174aab94..e5d4cb20689e7d51a0b834923bc787b7db9a75fb 100644 --- a/crates/languages/src/javascript/highlights.scm +++ b/crates/languages/src/javascript/highlights.scm @@ -150,6 +150,13 @@ "}" ] @punctuation.bracket +(ternary_expression + [ + "?" + ":" + ] @operator +) + [ "as" "async" diff --git a/crates/languages/src/tsx/highlights.scm b/crates/languages/src/tsx/highlights.scm index bbdd83bb4d4e9410886f9caa1ee6436e6b839948..26cf5c207b2cd4739a33af518d5201a4c7fee262 100644 --- a/crates/languages/src/tsx/highlights.scm +++ b/crates/languages/src/tsx/highlights.scm @@ -155,6 +155,13 @@ "}" ] @punctuation.bracket +(ternary_expression + [ + "?" + ":" + ] @operator +) + [ "as" "async" diff --git a/crates/languages/src/typescript/highlights.scm b/crates/languages/src/typescript/highlights.scm index eedcf79aedac77741c48c8f6574c76a8889a841a..f7b893da7a12b91d93ecf70f9c71346ed5225390 100644 --- a/crates/languages/src/typescript/highlights.scm +++ b/crates/languages/src/typescript/highlights.scm @@ -156,6 +156,13 @@ "}" ] @punctuation.bracket +(ternary_expression + [ + "?" + ":" + ] @operator +) + [ "as" "async"