# go: Highlight predeclared types and built-in functions \(\#59780\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ced0d857fd5ec5009e4caf7604db383896a1d5c4

Requested commit: ced0d857fd5ec5009e4caf7604db383896a1d5c4

Commit: ced0d857fd5ec5009e4caf7604db383896a1d5c4

Tree: 598d00bf60bc6c9a3cc7f274d744a9b109bf7bed

Author: sollniss

Committer: GitHub

## Message

```
go: Highlight predeclared types and built-in functions (#59780)

Tag Go's universe-scope identifiers as @type.builtin and
@function.builtin, matching Rust, TypeScript, and Python grammars (and
upstream tree-sitter-go / nvim-treesitter / Helix). Themes already style
these captures, so Go was the only major language not distinguishing
built-ins.

# Objective

Adds support for `@type.builtin` and `@function.builtin` targeted syntax
highlighting.

## Solution

Defined builtin functions and types in Go's highlights.scm.

## Testing

All screenshots are with `"semantic_tokens": "off"`. Built with
`--release` flag.

Before
<img width="591" height="619" alt="Screenshot_2026-06-24_03-15-56"
src="https://github.com/user-attachments/assets/996e48a0-4e46-45fa-a8fd-ff64820e58ac"
/>

<img width="591" height="619" alt="Screenshot_2026-06-24_03-15-11"
src="https://github.com/user-attachments/assets/b875c02b-80eb-4a4c-b9df-341ffd29ee5c"
/>

After

<img width="591" height="650" alt="Screenshot_2026-06-24_03-17-08"
src="https://github.com/user-attachments/assets/fca72a77-6359-4bb5-916e-a2e6e8b5c539"
/>

<img width="591" height="650" alt="Screenshot_2026-06-24_03-17-44"
src="https://github.com/user-attachments/assets/48a983ec-743c-4edc-abf3-915a759b2b23"
/>

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] 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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- go: Add support for highlighting builtin types and functions
```

## Parents

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

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