In VS Code, I'm using the Twig Language 2 extension to deal with Twig-like syntax inside HTML files (actually I use the Pebble templating engine). I configured VS Code so the brackets are colorized:
"files.associations": {
"*.html": "twig"
},
"[twig]": {
"editor.bracketPairColorization.enabled": true
},
"workbench.colorCustomizations": {
"editorBracketHighlight.foreground1": "#15d31e",
"editorBracketHighlight.foreground2": "#15d31e",
"editorBracketHighlight.unexpectedBracket.foreground": "#ff0000"
}
The colorization (green, in my case) works well when the {{
and }}
brackets are used "at the elements level" of the HTML file, but not when they are inside a string. For example:
Since the Twig/Pebble blocks are interpreted even when they are inside a string, it would make sense, in my opinion, to highlight the brackets there too.
Is this possible?
This seems to be tracked by an open issue ticket in the VS Code GitHub repo (which would mean that it's currently not supported): Enable bracket colorization within Strings #146453. Give it a thumbs up to show support for it, and subscribe to it to get notified of discussion and progress. Please avoid making noisy comments like "+1" / "bump".
The extension 2gua.rainbow-brackets does apply Bracket colorization within Strings... but it doesn't seem like you can edit the choice of bracket colors, and they don't contrast well with the color of string text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With