grammars: Distinguish control-flow keyword highlighting in Go - #63769
grammars: Distinguish control-flow keyword highlighting in Go#63769Gami13 wants to merge 1 commit into
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @Gami13 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'. |
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, localized to a highlight query file, and follows an existing capture convention already used by other grammars in the repository.
Pull request overview
Improves Go Tree-sitter highlighting by separating control-flow keywords from other language keywords, enabling themes (and optional Semantic Tokens) to style them differently and more consistently with other languages.
Changes:
- Split Go reserved words into two highlight capture groups:
@keywordand@keyword.control. - Reclassified control-flow-related keywords (e.g.
if,for,return,switch) under@keyword.controlwhile keeping non-control keywords (e.g.func,type,var) under@keyword.
File summaries
| File | Description |
|---|---|
| crates/grammars/src/go/highlights.scm | Splits Go keyword captures into @keyword vs @keyword.control for improved syntax highlighting fidelity. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Objective
Solution
highlights.scminto two groups:keyword.controlandkeyword. This change affects tree-sitter highlighting, enablingSemantic Tokenscan override it.Testing
Semantic Tokensdisabled. Opened a Go file with a theme that assigns different colors tokeywordandkeyword.controlSelf-Review Checklist:
Showcase
Release Notes: