-
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
tfvars files are showing as invalid - red underlining everywhere #1579
Comments
Hey @scott-doyland-burrows thanks for posting. I see you're using the WSL environment, can you double check the extension updated to v2.28.1 inside? In my own experience using WSL, I've noticed it can fall behind detecting updates inside WSL (or Dev Containers, etc) where the main editor shows the latest version. If that is updated, can you add a little more detail where the |
For me is the same, but only for .hcl files. It started after the latest update. Until now, it always has been working without any issues. Version: 1.83.0 |
Just downgraded to 2.27.2 and everything went back to normal. 28.0 and 28.1 have the problem. |
I uninstalled the extension completely. Restarted vscode and did NOT connect to WSL. Installed the extension at 2.28.1. I created a new folder in my Windows "Downloads" folder and created two files: Opening just the single file also shows the issue: Switching back to 2.27.2 fixes it. |
Side note: We generally treat autoloaded variable files differently to the other ones, i.e. I am not on Windows myself (macOS) but I was not able to reproduce the issue and I would not expect such a bug to be platform-specific.
On a separate note, you can stay on the latest version and disable the validation using the following option: "terraform.validation.enableEnhancedValidation": false, There should be no need to downgrade to older versions. |
I have found that if I name my
Note how the top screenshot shows a valid file (the bottom shows a |
I am on 0.32.1 Here is the log - I opened a new vscode window and opened the "invalid" file named
|
This comment was marked as off-topic.
This comment was marked as off-topic.
For the time being we do not provide validation for non-autoloaded tfvars files, i.e. any TL;DR we cannot tell if I have created a separate issue to discuss the other module related issue - I think that may still be a genuine bug, so let's continue conversation about that in #1582 |
A new version 2.28.2 was just released. This fixes the module related issue (#1582). The update should appear automatically in VS Code. With the correct file type, the behavior for In case you experience any different validation related bug, please do let us know through a new issue. |
@dbanck @radeksimko Just updated to .2 and for my case as mentioned in #1579 (comment) the problem still persists. I didn't have any of the problems reported from other people within .tfvars nor any .tf files using .28.0 nor .28.1, but only .hcl when used with Terragrunt. Edit: Should I open a separate issue or keep the conversation here? |
@ghs, yes please open a separate issue. But I'm not sure if we can help here. We don't support Terragrunt files in the extension or the language server. AFAIK, Terragrunt uses If you change the file type for "terraform.validation.enableEnhancedValidation": false, |
Thanks! Won't be needed. All good now! :) Not sure what had happened, but for some reason with the old version 2.27.2 everything worked fine including .hcl files. Validation, highlighting, autocomplete... With 2.28.1 .hcl files as I wrote started to appear as incorrect. I've just uninstalled and installed again HashiCorp Terraform and HashiCorp HCL extensions, restarted and things went back to normal. I suppose something messed up somehow on my side. Thanks again for your time! |
I just found this existing issue which I think covers pretty much all that can be said about the problem space right now, so you are free to subscribe to that one: hashicorp/terraform-ls#715 |
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. |
Extension Version
v2.28.1
VS Code Version
Version: 1.82.2 (user setup)
Commit: abd2f3db4bdb28f9e95536dfa84d8479f1eb312d
Date: 2023-09-14T05:55:25.390Z
Electron: 25.8.1
ElectronBuildId: 23779380
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19044
Operating System
Windows 10 with WSL
Terraform Version
Terraform v1.6.0 on linux_amd64 + provider registry.terraform.io/integrations/github v5.39.0
Steps to Reproduce
Define a
.tfvars
file and put in a valid config.Expected Behavior
.tfvars
file should shows as valid.Actual Behavior
Terraform Configuration
terraform
.tfvars file
Project Structure
Gist
No response
Anything Else?
No response
Workarounds
No response
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: