Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fmt on save not working with vscode 1.11.1 #16

Closed
commarla opened this issue Apr 12, 2017 · 9 comments
Closed

Fmt on save not working with vscode 1.11.1 #16

commarla opened this issue Apr 12, 2017 · 9 comments

Comments

@commarla
Copy link

Hi,

Thanks for the good work on this extension.
Since the last update of vscode, the fmt on save doesn't work anymore. I have update to 0.0.7 and added "terraform.formatOnSave": true to my use settings.

My coworker has the same problem.

Laurent.

@jharley
Copy link

jharley commented Apr 12, 2017

I'm seeing the same thing with 0.0.7 using Code 1.11.1

@mauve
Copy link
Contributor

mauve commented Apr 12, 2017

Sorry for the breakage, however this is a bit weird as it works on vscode 1.11.1 with 0.0.7 for me.

My terraform settings are:

terraform.formatOnSave: true,
terraform.formatVarsOnSave: null,
terraform.path: /Users/mauve/.bin/terraform

It works for both .tfvars and .tf files for me.

Can you please post your settings? Is it broken for all terraform files or for just .tf or .tfvars?

@jharley
Copy link

jharley commented Apr 12, 2017

Huh! Looks like terraform.formatOnSave got changed to "false"?! It's been working for months :\

It's working now that I changed the setting.. but I wonder how/why it got swapped?

Edit: to be more clear - I was relying on the defaults and had no local setting overrides.

@andrewmeissner
Copy link

andrewmeissner commented Apr 12, 2017

My user settings are

    "terraform.path": "/usr/local/bin/terraform",
    "terraform.formatOnSave": true,
    "terraform.formatVarsOnSave": true,

and I still can't format on save. :(

VsCode 1.11.1
vscode-terraform 0.0.8
terraform v0.8.8

EDIT: I discovered my problem. There seems to be some sort of conflict with this plugin: https://marketplace.visualstudio.com/items?itemName=wholroyd.HCL

This plugin provides syntax highlighting for all HCL files, including terraform files. These were working together previous to the release of 0.0.7. @mauve , would it be possible to maintain that harmony? I don't like having to disable the HCL plugin so formatOnSave will work. :(

@mauve
Copy link
Contributor

mauve commented Apr 12, 2017

the default configuration for formatOnSave used to be true but I changed it to false for 0.0.6 that might have caused some confusion.

@andrewmeissner do you only need the other plugin because it also handles .hcl files? I haven't seen files with the .hcl ending before so I can just add it.

#17

@commarla
Copy link
Author

I confirm @andrewmeissner answer, vscode-terraform and wholroyd.HCL can't work together anymore. It was working before.

@commarla
Copy link
Author

I don't remember why I have wholroyd.HCL installed. I have disabled it and I am fine.

@mauve
Copy link
Contributor

mauve commented Apr 12, 2017

I just released a version which also handles .hcl files, if I got this correctly the only thing missing from the Terraform plugin was that, I will close this bug now.

Thanks for reporting!

@commarla
Copy link
Author

@andrewmeissner workaround here #18 (comment)

@ghost ghost locked and limited conversation to collaborators Jun 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants