You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This extension is great for Go template files which are pure text based files. But I use a lot of YAML, TOML or even shell (bash/zsh) files which are templated with Go in different projects. In such scenarios, I have to choose between having the base language syntax highlighting (in which case any Go templating is considered as an error and breaking anything after the first templating instance) or having the Go template syntax highlighting (in which case I lose any other base language highlighting). Ideally, it would be great to have both highlighting working.
From the screenshot above, you can see that this combination of syntax allows for:
the repeated path field to be detected as an error for the YAML structure
give proper syntax highlighting for both languages (YAML + Go Template)
offers completion for Go templating
the $bas typo to be detected as an error as this Go Template variable doesn't exist
Currently, when using this extension, I have to choose between the go-template file type (1) and the yaml file type. These give me the below results:
(1)
(2)
Note
Maybe I just didn't understand how to set up this extension and it already supports it. If this is the case, I'm happy to open a little PR to add a line or two in the README.md as it seems that I'm not the only one being a bit confused for this specific point. For example, see this StackOverflow issue.
When looking for similar issues in this GitHub repository (and potential solutions/settings), I found this response mentioning an issue that apparently has been resolved by VS Code now.
The text was updated successfully, but these errors were encountered:
Feature request description
This extension is great for Go template files which are pure text based files. But I use a lot of YAML, TOML or even shell (bash/zsh) files which are templated with Go in different projects. In such scenarios, I have to choose between having the base language syntax highlighting (in which case any Go templating is considered as an error and breaking anything after the first templating instance) or having the Go template syntax highlighting (in which case I lose any other base language highlighting). Ideally, it would be great to have both highlighting working.
As an illustration of what I'm talking about, GoLand offers this feature with the Go Template extension and a setting tweak.
From the screenshot above, you can see that this combination of syntax allows for:
path
field to be detected as an error for the YAML structure$bas
typo to be detected as an error as this Go Template variable doesn't existCurrently, when using this extension, I have to choose between the
go-template
file type (1) and theyaml
file type. These give me the below results:(1)
(2)
Note
Maybe I just didn't understand how to set up this extension and it already supports it. If this is the case, I'm happy to open a little PR to add a line or two in the
README.md
as it seems that I'm not the only one being a bit confused for this specific point. For example, see this StackOverflow issue.When looking for similar issues in this GitHub repository (and potential solutions/settings), I found this response mentioning an issue that apparently has been resolved by VS Code now.
The text was updated successfully, but these errors were encountered: