Ask questionsterraform fmt on save not actually occurring
If have Format on Save enabled, and on saving a .tf file, the output shows it running
terraform fmt on the file:
2019-03-29 15:15:41:274 [INFO ] formatting-provider: running 'terraform fmt' on 'c:\Users\user\project-dir\main.tf' 2019-03-29 15:15:41:275 [INFO ] runner: Running terraform cwd='C:\Users\user\AppData\Local\Programs\Microsoft VS Code' path='terraform' (version: 0.11.11) args=[fmt, -] 2019-03-29 15:15:42:492 [INFO ] file-system-watcher: Indexed file:///c%3A/Users/user/project-dir/main.tf 2019-03-29 15:15:44:340 [INFO ] runner: Running terraform succeeded.
However, the formatting is not applied and file remains unchanged.
terraform fmt on the file via the console has the expected formatting effect on the file.
This issue was also mentioned by @IronFarm in https://github.com/mauve/vscode-terraform/issues/62#issuecomment-426944230
Answer questions udondan
Anyone found a solution or knows the cause? I'm having this problem since some weeks and can't find a solution. The Terraform output window shows it is running but nothing happens with the document.
2019-11-18 09:01:37:238 [INFO ] formatting-provider: running 'terraform fmt' on '/path/to/file.tf' 2019-11-18 09:01:37:238 [INFO ] runner: Running terraform cwd='/' path='/usr/local/bin/terraform' (version: 0.12.15) args=[fmt, -] 2019-11-18 09:01:38:189 [INFO ] runner: Running terraform succeeded.
I'm confused about the args:
Is the 2nd arg a placeholder for the filename? Or is that the issue?