# grammars: Distinguish control-flow keyword highlighting in Go \(\#63769\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1c3aa005ac5d5dce5378006d6a8c8b7549122907)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1c3aa005ac5d5dce5378006d6a8c8b7549122907

Requested commit: 1c3aa005ac5d5dce5378006d6a8c8b7549122907

Commit: 1c3aa005ac5d5dce5378006d6a8c8b7549122907

Tree: c86020a158dff5eec86f63672437aba5d4d7b426

Author: Gami

Committer: GitHub

## Message

```
grammars: Distinguish control-flow keyword highlighting in Go (#63769)

# Objective
- Improve Go's syntax highlighting by distinguishing control-flow
keywords from other keywords, in the same way it was done for other
languages.

## Solution

- Split keywords in `highlights.scm` into two groups: `keyword.control`
and `keyword`. This change affects tree-sitter highlighting, enabling
`Semantic Tokens` can override it.

## Testing

- Tested locally on Windows using a development build, with `Semantic
Tokens` disabled. Opened a Go file with a theme that assigns different
colors to `keyword` and `keyword.control`

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

- Screenshot showing a build without this change and one with it side by
side
<img width="930" height="154" alt="after"
src="https://github.com/user-attachments/assets/bf3f612f-0ffc-40e4-b4c3-7002fff49fb7"
/>


Release Notes:
- Improved Go syntax highlighting by separating control-flow keywords
from regular keywords

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
```

## Parents

- [5a9b9558db01a6b906cec2fb70a797affdc58cdd](https://git.cafe/gitcafe/zed/commit/5a9b9558db01a6b906cec2fb70a797affdc58cdd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1c3aa005ac5d5dce5378006d6a8c8b7549122907?format=markdown)
