feat: add syntax highlighting rules for GritQL#150
Merged
Conversation
Contributor
Author
|
If I can get biomejs/tree-sitter-gritql#25 approved, we can highlighting for the code snippet inside GritQL too (depending on whether we want it or not). |
Contributor
Author
|
tidefield#1 with code injection, it looks awesome! |
siketyan
approved these changes
Sep 22, 2025
Contributor
Author
|
Thanks @siketyan for approving. What can I do to merge the PR? |
ematipico
approved these changes
Sep 22, 2025
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.
This PR introduces custom syntax highlighting rules for GritQL in Zed, relying on the official tree-sitter parser from honeycombio.
There are two building blockers that make up syntax highlighting
While we could use the recently released https://zed.dev/extensions/grit extension, it has a few limitations:
Defining our own rules (as in this PR) allows us to ensure full coverage and compatibility, with minimal overhead. Relying on the official parser also makes future maintenance easier. Any custom syntax (e.g.,
engine biome) can be contributed and converged with the official parser for broader support.There are two TODO items I wish to accomplish after this PR:
engine biomein addition toengine marzano(requires upstream fix to tree-sitter parser)See the screenshots below for a side-by-side comparison between our own rules and the GritQL extension.
Biome's rules
Existing GritQL extension's rules
Fixes: #125