-
Notifications
You must be signed in to change notification settings - Fork 182
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
Can't format files after upgrade to 2.0.1 #375
Comments
The v2 extension should respect the standard See https://code.visualstudio.com/docs/getstarted/settings The extension does not format I'm not sure what the best practice is for formatting support in similar extensions and whether we should consider adding a more scoped settings there and how should that interact with the global one. 🤔 |
@radeksimko It appears it doesn't work anymore :(
Still, my Also, is there a plan to support |
this is my previous usersettings.json |
"[terraform]": {},
"terraform.format": {
"enable": true,
"formatOnSave": true
}, Unfortunately this does not enable formatting in the latest version, you would need to use the I'd suggest we check how other popular similar (non-Terraform) extensions deal with this and whether they have a dedicated formatting settings, before adding it back. @NightmareCinema The following seems to be working for me: "[terraform]": {
"editor.formatOnSave": true
}, Can you double check you put this in the right place in the settings file? I'm not sure what else could differ, but it does work for me. |
let me try @radeksimko |
@radeksimko so should look like this? "[terraform]": {
"editor.formatOnSave": true
},
"terraform.languageServer": {
"external": true,
// "pathToBinary": "/Users/fernando/.vscode-insiders/extensions/hashicorp.terraform-2.0.1/lsp/terraform-ls",
"args": [
"serve"
]
}, |
formatting isn't working still. not sure what i am missing |
In case it helps anybody. This didn't start working for me until I added: {
"[terraform]": {
"editor.formatOnSave": true
}
} and I opened my terraform folder as the root of the workspace. Resolving |
This is the global setting on a clean install of VS Code: {
"editor.formatOnSave": true
} As others have mentioned, this is the language specific setting: {
"[terraform]": {
"editor.formatOnSave": true
}
} And you would just use the built-in command |
If its still not working, can you grab the logs from the |
|
This sounds like the same problem I am having with the 2.0 release. It require that the root of the VS Code workspace contains an I am trying to find some sort of documentation or discussion of this, but so far no joy. |
I believe this is related to #366 . |
Echoing @larslevie's point - I work primarily in a Git repo where there are multiple isolated Terraform environments in separate folders, along with a In order for the 2.0.1 language server to even function, it expects me to have ran |
As others mentioned, the use case of not having Moreover, it proves to be problematic having to run |
Yes this is definitely an oversight that we should be addressing soon, here is the tracking issue on the LS: hashicorp/terraform-ls#165 Going to close this in favor of that, the LS will contain the fix. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
There seems to be no option to format
.tf
.tfvars
.hcl
files after the upgrade anymore :(The text was updated successfully, but these errors were encountered: