Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Highlight `?` and `:` in ternary expressions as operator in JavaScript, TypeScript, and TSX (#20573)

狐狸33f09bad60cf
diff --git a/crates/languages/src/javascript/highlights.scm b/crates/languages/src/javascript/highlights.scm
index a89375dee2a..e5d4cb20689 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 bbdd83bb4d4..26cf5c207b2 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 eedcf79aeda..f7b893da7a1 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"