From 04e53bff3d96693a8c3e21188d17cc4e80abe97f Mon Sep 17 00:00:00 2001 From: Dijana Pavlovic Date: Mon, 3 Nov 2025 15:51:22 +0100 Subject: [PATCH] Move @punctuation.delimiter before @operator capture (#41663) Closes #41593 From what I understand the order of captures inside tree-sitter query files matters, and the last capture will win. `?` and `:` are captured by both `@operator` and `@punctuation.delimiter`.So in order for the ternary operator to win it should live after `@punctuation.delimiter`. Before: Screenshot 2025-10-31 at 17 41 21 After: Screenshot 2025-10-31 at 17 41 33 Release Notes: - Fixed an issue where the ternary operator symbols in TypeScript would not be highlighted as operators. --- crates/languages/src/typescript/highlights.scm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/languages/src/typescript/highlights.scm b/crates/languages/src/typescript/highlights.scm index 8a85dfea07fe4f50cb271f65ec1bdeeaf2ea150c..6474ba2a05af330b1a7bd2da8ed3411b9132fe22 100644 --- a/crates/languages/src/typescript/highlights.scm +++ b/crates/languages/src/typescript/highlights.scm @@ -121,6 +121,15 @@ ; Tokens +[ + ";" + "?." + "." + "," + ":" + "?" +] @punctuation.delimiter + [ "..." "-" @@ -179,15 +188,6 @@ ] @operator ) -[ - ";" - "?." - "." - "," - ":" - "?" -] @punctuation.delimiter - [ "(" ")"