vscode-twig-language-2
vscode-twig-language-2 copied to clipboard
Auto-indent
The auto-indent (on return between brackets) present in HTML files in VSCode isn't functioning in Twig files.
Definitely don't know what I'm doing but perhaps it requires some "indentationRules" in the language config like this? (Stolen from the PHP language config):
"indentationRules": {
"increaseIndentPattern": "({(?!.*}).*|\\(|\\[|((else(\\s)?)?if|else|for(each)?|while|switch|case).*:)\\s*((/[/*].*|)?$|\\?>)",
"decreaseIndentPattern": "^(.*\\*\\/)?\\s*((\\})|(\\)+[;,])|(\\][;,])|\\b(else:)|\\b((end(if|for(each)?|while|switch)|break);))"
},
https://code.visualstudio.com/api/language-extensions/language-configuration-guide#indentation-rules
I've attempted to add this myself in a fork of the extension - but no luck. Any help appreciated.
I'm also noticing this issue as well, with no luck resolving.
Is this the same problem as #16?
It's been driving me around the bend, I ended up going for the Twig extension by whatwedo. It doesn't appear to be as good but the indents work.
This issue is bothering me too, found no workaround or fix.