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 a89375dee2..e5d4cb2068 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 bbdd83bb4d..26cf5c207b 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 eedcf79aed..f7b893da7a 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"