vscode-language-terraform
vscode-language-terraform copied to clipboard
Feature Request: formatting
It would be really cool if the plugin could run something like terraform fmt FILE
on the current file, on save or something
For reference: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting
While the official HashiCorp plugin does this, I much prefer this plugin (lightweight and simple). However, not having this feature really slows down my workflow. However, I did find a decent workaround to replicate this feature, via an external plugin: https://github.com/emeraldwalk/vscode-runonsave
I added this to my settings.json
:
"emeraldwalk.runonsave": {
"commands": [
{
"match": ".tf",
"cmd": "terraform fmt ${file}"
},
]
}
And now I can have terraform fmt
run after I save .tf
files. Nevertheless, it would be really nice if this is supported natively.
I'd also like to have a formatting function.