-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Go] Add support for YAML Go templates #4014
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well for me.
As for where this is used: I've come across YAML with Go templates in the context of Helm and Rancher. |
Actually, multi-line comments in blocks are not recognized (not sure if this is a common syntax):
Edit: Turns out this is a limitation of the Furthermore, I think the string after
Currently it's a string. Though, this is more of a Go issue since it stems from the existing Go template contexts being included. |
This comment was marked as duplicate.
This comment was marked as duplicate.
This commit... 1. adds a special `match-block-string-templates` with out closing `}}` checks, to support interpolation within multi-line strings (for use in YAML). 2. adds tests for multi-line comments in HTML and Markdown templates.
Now using a string interpolation context without safe guards (no check for closing |
Well, Go template syntax doesn't treat certain commands' arguments special by any means, currently to keep it lean. According to https://docs.gomplate.ca/syntax/#nested-templates Haven't investigeted which else commands would be affected. That's certainly a separate feature request, not related with supporting YAML. |
Yes, certainly. |
The lines with a sequence of
This is probably non-trivial and might require a refactoring of the YAML syntax since |
This commit excludes interpolation content from YAML key detection patterns. Everything within interpolation is ignored, even if it looks like a YAML key.
I've tweaked the key lookaheads so they ignore anything within |
This PR...
source.json.go
scope in snippet selectors