Replace highlight captures that don't work in Zed#52
Merged
MrSubidubi merged 2 commits intoJul 20, 2026
Conversation
- replace Lua-style %d in #match? predicates with \d: Zed's regex engine never matched them, so numeric literals fell through to the @string capture - replace @float with @Number: Zed themes have no "float" style - replace @field with @Property: Zed themes have no "field" style, leaving column names unstyled
MrSubidubi
approved these changes
Jul 20, 2026
MrSubidubi
left a comment
Contributor
There was a problem hiding this comment.
Very nice, thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
languages/sql/highlights.scmcontains patterns that appear to have been carried over from nvim-treesitter and do not work in Zed:#match?predicates for numeric literals use Lua-style character classes (%d), which Zed's (Rust) regex engine never matches. As a result, all numeric literals fall through to the earlier(literal) @stringcapture and are highlighted as strings.@floatis not a syntax style that exists in Zed themes, so even if the predicate matched, float literals would be unstyled.@fieldis not a capture that maps to any Zed theme style either, so Zed silently discards it and column names fall back to the earlier(identifier) @variablecapture instead of being styled as properties.Partially addresses the "inconsistent highlighting" reports in #37 (string-colored numbers).
Changes
%dwith\din the#match?predicates@floatwith@number(Zed has nofloatstyle)@fieldwith@property(Zed has nofieldstyle)Before / After
100.25,1.08,5)@field→@propertyhas no visual effect in themes wherevariableandpropertyshare a color (e.g. VS Code Dark Modern derivatives), but it makes column names use the intendedpropertystyle instead of falling back to@variablevia Zed silently discarding the unknown@fieldcapture.Not addressed (grammar-level, out of scope)
These remain unhighlighted because tree-sitter-sql cannot parse them, which a query-only change cannot fix:
SAVEPOINTstatements$$ ... $$), e.g. plpgsql function bodiesINTERVAL