Add support for Rego String Interpolation - #19
Merged
FallenAngel97 merged 4 commits intoJan 14, 2026
Conversation
- Run tree-sitter init to generate modern bindings for various languages. - Add ESLint configuration based on eslint-config-treesitter. - Update Node version to v24.11.1 in .nvmrc - Update README with npm commands, I have migrated to npm as it's what other similar projects seem to be using. I have used https://github.com/tree-sitter/tree-sitter-rust/tree/master, as an example for a number of the updates.
Implement string interpolation for both double-quoted and raw strings:
- $"{expr}" for double-quoted interpolated strings
- $`{expr}` for raw interpolated strings
Please see open-policy-agent/opa#8109 for the upstream
work on this same feature.
Other related merged PRs for other editors and projects:
- open-policy-agent/vscode-opa#375 (VS Code OPA ext)
- open-policy-agent/opa#8092 (OPA Docs)
charlieegan3
force-pushed
the
string-interpolation
branch
from
January 6, 2026 20:00
ca393a5 to
9cb6f1a
Compare
FallenAngel97
requested changes
Jan 10, 2026
FallenAngel97
left a comment
Owner
There was a problem hiding this comment.
Hello @charlieegan3 !
Thank you for the PR.
I checked it locally, all good except of few minor things.
Contributor
Author
|
Thanks for the review! I will make the changes next week and get back to you then. |
Requested from review comments on FallenAngel97#19
Contributor
Author
|
Hey, I have just updated this now, please see bc8b83c |
Owner
|
Thank you, @charlieegan3 ! Merging |
Contributor
Author
|
Thanks @FallenAngel97 ! |
charlieegan3
added a commit
to charlieegan3/nvim-treesitter
that referenced
this pull request
Jan 15, 2026
We have released a new langauge feature for string interpolation and the new grammar is available from this commit following PR FallenAngel97/tree-sitter-rego#19
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.
Hello @FallenAngel97! In OPA 1.12 we released support for string interpolation (https://github.com/open-policy-agent/opa/releases/tag/v1.12.0).
This PR is my work to add this feature to tree-sitter-rego so we can support highlighting of this new syntax in editors using this library (I have been testing in the helix editor).
We have added support for this in various other places, e.g. open-policy-agent/vscode-opa#375
I have also taken some inspiration from the Rust tree-sitter implementation to modernise this project's structure too. Hope that's ok, please see the first commit for that work.
Let me know if you have any questions or comments 🙂