-
Notifications
You must be signed in to change notification settings - Fork 182
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
Support Color Syntax Highlighting for Templates (tmpl, etc) #496
Comments
This comment has been minimized.
This comment has been minimized.
I'm using JSON files templates with terraform .json.tpl, it would be nice to add syntax highlighting for those as well |
Guys, .yaml.tpl too, please |
For searchability I'll also reference the file extension |
FWIW you can get limited support by opening a file of the extension in question, then This results equivalently in the following addition to your user settings JSON:
Obviously it doesn't specifically handle the surrounding language (e.g. json/yaml) interleaved with the templating syntax, but it's a lot better than having zero syntax highlighting. |
FYI We track support for various formats under #636 and For the template formats which involve YAML, JSON or any other non-Terraform or non-HCL language - I will discuss that with the rest of the team, but I expect these formats to be generally more difficult to support. The more dominant component which needs to be highlighted in that context is arguably YAML/JSON, i.e. even if there was a solution for highlighting e.g. The same problem affects Markdown, although there the division between the languages is a little clearer/cleaner. On that note - if we were to tackle this non-trivial problem, I imagine Markdown would be the first format to support, also because it's a format frequently used for documentation. |
@radeksimko, I'm guessing this won't be done anytime soon? |
Current Version
Use-cases
As a developer, I would like to use terraform templates that have terraform parts with color syntax highlighting. Furthermore, with different file formats, e.g. YAML, JSON, bash, etc., I would like to have the host language have highlighted, in addition to the terraform language used for templating.
The only way to solve this is to use an alternative color syntax highlighting solution that supports colorizing templates.
Attempted Solutions
Proposal
As an example, I would have a template that creates called
cluster_config.yaml.tmpl
that has this snippetI would expect values like
${variable}
or%{stuff}
to be highlighted as appopriate, such as reserved words in, for, endforFor terraform code to supply the values, I would do something like this:
Related LSP methods
Not sure I understand the content from this.
References
I searched and did not find anything.
The text was updated successfully, but these errors were encountered: