Skip to content

Conversation

@diksipav
Copy link
Contributor

@diksipav diksipav commented Oct 31, 2025

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.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 31, 2025
@probably-neb
Copy link
Collaborator

Nice catch. Thanks!

@probably-neb probably-neb merged commit 04e53bf into zed-industries:main Nov 3, 2025
27 checks passed
P1n3appl3 pushed a commit to bnjjj/zed that referenced this pull request Nov 4, 2025
…41663)

Closes zed-industries#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:
<img width="298" height="32" alt="Screenshot 2025-10-31 at 17 41 21"
src="https://github.com/user-attachments/assets/af376e52-88be-4f62-9e2b-a106731f8145"
/>


After:
<img width="303" height="39" alt="Screenshot 2025-10-31 at 17 41 33"
src="https://github.com/user-attachments/assets/9a754ae9-0521-4c70-9adb-90a562404ce8"
/>


Release Notes:

- Fixed an issue where the ternary operator symbols in TypeScript would
not be highlighted as operators.
tomatitito pushed a commit to tomatitito/zed that referenced this pull request Nov 7, 2025
…41663)

Closes zed-industries#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:
<img width="298" height="32" alt="Screenshot 2025-10-31 at 17 41 21"
src="https://github.com/user-attachments/assets/af376e52-88be-4f62-9e2b-a106731f8145"
/>


After:
<img width="303" height="39" alt="Screenshot 2025-10-31 at 17 41 33"
src="https://github.com/user-attachments/assets/9a754ae9-0521-4c70-9adb-90a562404ce8"
/>


Release Notes:

- Fixed an issue where the ternary operator symbols in TypeScript would
not be highlighted as operators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

2 participants