Closed Sneedes closed 1 year ago
Not really sure how to troubleshoot/diagnose further.
This was working on my workstation/environment some time ago.
Hi @Sneedes, It doesn't look like formatting is being triggered at all.
Can you confirm you have set the following settings? https://github.com/hashicorp/vscode-terraform#formatting
I think that would only apply to triggering a format on save?
Regardless...updated my settings.json
. Hopefully correctly. And reloaded Code.
{ "workbench.colorTheme": "Default Dark+", "security.workspace.trust.untrustedFiles": "open", "remote.SSH.remotePlatform": { "ashs05023.ibechtel.com": "linux" }, "git.ignoreLegacyWarning": true, "terraform.experimentalFeatures.prefillRequiredFields": true, "editor.suggest.preview": true, "terraform.codelens.referenceCount": true, "[terraform]": { "editor.defaultFormatter": "hashicorp.terraform", "editor.formatOnSave": true, "editor.formatOnSaveMode": "file" }, "[terraform-vars]": { "editor.defaultFormatter": "hashicorp.terraform", "editor.formatOnSave": true, "editor.formatOnSaveMode": "file" }, }
Still no formatting ocurring.
I think that would only apply to triggering a format on save?
You are absolutely right, I'm sorry I missed the important part in your first comment
Right click > Format Document
After more closely looking at the log, I can see that there's an RPC request hanging and other requests (including formatting) queuing after it. This could be related to some bugs we recently fixed, in particular https://github.com/hashicorp/terraform-ls/pull/1006
Can you try disabling the hashicorp.terraform
(stable version) and installing the preview, to see if it's reproducible there?
https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform-preview
We will be rolling out what's in preview into stable very soon, likely next week or so.
Switching to the HashiCorp.terraform-preview version of the Extension worked for me.
Thanks.
Thanks for verifying - we will close this with 2.24.0 release then, which will become available under the existing Marketplace entry HashiCorp.terraform
.
Version 2.24.0 has been released today. Please let us know if it resolved this issue for you.
Uninstalling the Preview version and installing 2.24.0 appears to have resolved my issue.
Side note...noting that the Changelog shows 2.24.0 (Unreleased). Was expecting to see todays date.
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Issue Description
Format Document no longer working for TF files.
Environment Information
Terraform Information
Version: 1.0.8 Platform: linux_amd64 Outdated: false
Visual Studio Code
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
|Extension|Author|Version| |---|---|---| |azure-account|ms-vscode|0.11.1| |jupyter|ms-toolsai|2022.7.1102252217| |jupyter-renderers|ms-toolsai|1.0.9| |powershell|ms-vscode|2022.7.2| |python|ms-python|2022.12.0| |terraform|hashicorp|2.23.0| |vscode-pylance|ms-python|2022.8.20| |vscode-yaml|redhat|1.9.1| |vscodeintellicode|VisualStudioExptTeam|1.2.22|Extension Logs