Skip to content

go: Add semantic token rule for format string interpolations#52394

Merged
Veykril merged 1 commit intozed-industries:mainfrom
MFattakhov:go-semantic-format-args-by-default
Mar 25, 2026
Merged

go: Add semantic token rule for format string interpolations#52394
Veykril merged 1 commit intozed-industries:mainfrom
MFattakhov:go-semantic-format-args-by-default

Conversation

@MFattakhov
Copy link
Copy Markdown
Contributor

@MFattakhov MFattakhov commented Mar 25, 2026

Context

Closes #52391

gopls sends semantic tokens for format args with [format] modifier. Without a simple support for there is no special highlighting for format args like %s. Its a simple change inside go/semantic_token_rules.json that makes this a default behavior.

Currently (on 0.229 preview):
Screenshot 2026-03-25 at 11 34 57

After fix:

Screenshot 2026-03-25 at 11 58 37

Self-Review Checklist

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • gopls: Add semantic token rule for format string interpolations

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 25, 2026
@MFattakhov
Copy link
Copy Markdown
Contributor Author

Hey @Veykril ! I have seen you approved and merged #51621, this is kinda the same, can you look?

Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril changed the title made gopls semantic tokens for format args being parsed by default go: Add semantic token rule for format string interpolations Mar 25, 2026
@Veykril Veykril enabled auto-merge (squash) March 25, 2026 09:03
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, rtfeldman and smitbarmase and removed request for a team March 25, 2026 09:04
@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Mar 25, 2026
@Veykril Veykril merged commit 90fa50a into zed-industries:main Mar 25, 2026
42 checks passed
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 first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions Size S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

semantic token highlights: golang's string formatting is not highlighed semantically by default

3 participants