Skip to content

Highlight case keyword in if-case expressions#76

Open
fatalaa wants to merge 1 commit intozed-extensions:mainfrom
fatalaa:fix/if-case-highlight
Open

Highlight case keyword in if-case expressions#76
fatalaa wants to merge 1 commit intozed-extensions:mainfrom
fatalaa:fix/if-case-highlight

Conversation

@fatalaa
Copy link
Copy Markdown

@fatalaa fatalaa commented Mar 27, 2026

The tree-sitter grammar parses case in if-case patterns (e.g., if (x case String value)) as an anonymous "case" node, unlike switch statements which use the named case_builtin node. This meant case was unhighlighted in if-case expressions.

Add "case" to the @keyword.conditional group alongside if, else, switch, and default.

Fixes part of #29

image

The tree-sitter grammar parses `case` in if-case patterns (e.g.,
`if (x case String value)`) as an anonymous `"case"` node, unlike
switch statements which use the named `case_builtin` node. This
meant `case` was unhighlighted in if-case expressions.

Add `"case"` to the `@keyword.conditional` group alongside `if`,
`else`, `switch`, and `default`.

Fixes part of zed-extensions#29
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Mar 27, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @fatalaa on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@fatalaa
Copy link
Copy Markdown
Author

fatalaa commented Mar 27, 2026

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Mar 27, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Mar 27, 2026

The cla-bot has been summoned, and re-checked this pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant