Skip to content

language_core: Introduce fallback highlights#52575

Merged
SomeoneToIgnore merged 6 commits intomainfrom
fallback-highlights-v2
Apr 2, 2026
Merged

language_core: Introduce fallback highlights#52575
SomeoneToIgnore merged 6 commits intomainfrom
fallback-highlights-v2

Conversation

@MrSubidubi
Copy link
Copy Markdown
Member

@MrSubidubi MrSubidubi commented Mar 27, 2026

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:

  • Added the option for highlights from languages to specify fallbacks. That means that if you have a pattern with the captures @second.capture @first.capture, Zed will first try resolving a highlight from your theme for the code fragment using the first capture, then look for the second capture if no match for the first capture could be found.

@MrSubidubi MrSubidubi requested a review from osiewicz March 27, 2026 14:29
@MrSubidubi MrSubidubi self-assigned this Mar 27, 2026
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Mar 27, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Mar 27, 2026
@AlternateRT
Copy link
Copy Markdown
Contributor

... then look for the first capture if no match for the first capture could be found

Don't you mean "... then look for the second capture if no match for the first capture could be found"?

@MrSubidubi
Copy link
Copy Markdown
Member Author

MrSubidubi commented Mar 30, 2026

Don't you mean "... then look for the second capture if no match for the first capture could be found"?

Yes, I very much do 😅 Thank you!

SomeoneToIgnore and others added 3 commits April 2, 2026 14:39
Co-authored-by: MrSubidubi <dev@bahn.sh>
Co-authored-by: MrSubidubi <dev@bahn.sh>
@MrSubidubi MrSubidubi marked this pull request as ready for review April 2, 2026 12:35
@SomeoneToIgnore SomeoneToIgnore self-assigned this Apr 2, 2026
@SomeoneToIgnore SomeoneToIgnore enabled auto-merge (squash) April 2, 2026 12:47
@SomeoneToIgnore SomeoneToIgnore merged commit 4deb400 into main Apr 2, 2026
31 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the fallback-highlights-v2 branch April 2, 2026 12:52
piper-of-dawn pushed a commit to piper-of-dawn/zed that referenced this pull request Apr 25, 2026
Self-Review Checklist:

- [X] 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](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Release Notes:

- Added the option for highlights from languages to specify fallbacks.
That means that if you have a pattern with the captures `@second.capture
@first.capture`, Zed will first try resolving a highlight from your
theme for the code fragment using the first capture, then look for the
second capture if no match for the first capture could be found.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
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 staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants