-
Notifications
You must be signed in to change notification settings - Fork 180
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
Plugin formatting still not working after installing Preview version #1030
Comments
Thanks for the report, sorry you're experiencing this. We have two bug fixes landing soon that may be related to your situation:
But I won't be able to tell until we dig further in what's going on here. Can you print out a simplified and/or redacted folder setup you're using? For example opening |
Thanks James. Yes the folder structure that I'm experiencing the problem today is (simplified/redacted version):
Let me know if I can provide more info. |
@mbacchi Do you mind sharing the whole log, or at least all lines which contain You can find it under the Thanks! |
If you're worried about sensitive data, you may encrypt the log using my pubkey before posting it here and/or send it to radek |
Thank you @radeksimko, I just saw this request and sent you a truncated log to your email. Let me know if you have further questions. |
I worked with Radek on this via email to troubleshoot further. It boiled down to the fact that I had configured the plugin in settings.json according to this documentation, but when I started using the preview plugin that did not work because the config setting Once I corrected this to use Thanks @radeksimko for your help! |
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. |
Versions
This bug is reproducible in:
Extension
Language Server
VS Code
Operating System
Terraform Version
Steps To Reproduce
Terraform files are not formatted when saved. I chatted with James Pogran on Twitter (https://twitter.com/ender2025/status/1505941271789113349?s=20&t=Lhe0k1qRB3rfNZ0t9i1GqA) and he suggested using the Preview version. I did this and made the other changes to the settings configuration that he recommended from here; https://github.com/hashicorp/vscode-terraform#formatting.
At first this worked, but now after maybe a week or 10 days of using the preview, I no longer have a guarantee of formatting the file when I save it. In fact at the moment it feels like it rarely if ever formats on save.
I have a current file with some resources formatted this way:
(Notice the equal signs not lined up.)
I saved the file multiple times and reloaded vscode, and still it doesn't format correctly.
I have to run
terraform fmt
in order to format it correctly now.After running
terraform fmt
it looks like:Expected Behavior
Formatting should be applied when the file is saved.
Actual Behavior
Formatting of many/most files is not applied when saved.
Additional context
The text was updated successfully, but these errors were encountered: