vscode-terraform
vscode-terraform copied to clipboard
Autocomplete `required_providers` object
Versions
Extension
Name: HashiCorp Terraform Id: hashicorp.terraform Description: Syntax highlighting and autocompletion for Terraform Version: 2.23.0 Publisher: HashiCorp VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform
VS Code
Version: 1.64.2 (system setup) Commit: f80445acd5a3dadef24aa209168452a3d97cc326 Date: 2022-02-09T22:02:28.252Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19044
Operating System
Windows 10 Version 21H2 for x64-based Systems
Terraform Version
Terraform v1.2.6 on windows_amd64
If applicable, add screenshots to help explain your problem.
-->
This is how it should autocomplete after the "name" block is selected the "source" & "value" are automatically come up
Below screenshot after adding "name" block the the "source" & "value" does not populate
Additional context
I have uninstalled & reinstalled VS Code, reinstalled the HashiCorp Terraform extension, removed & reinstalled/copied terraform.exe but still its not auto populating as per the previous screenshot where it shows after adding "name" block the "source" & "value" add automatically
Hi @vinay-menon336 Thank you for the suggestion.
The completion of expressions (anything after = in HCL) generally needs a lot of work still - we track it under https://github.com/hashicorp/vscode-terraform/issues/641
Just to clarify, you're hoping to have the inside of {} filled out when you do the following completion, correct?

If so - that makes sense! The only thing on our side we'll need to figure out is how to decide which fields to complete or not.
We could complete just the required ones, which is just the source.
However I think we should be completing version as well, to promote best practice of provider version pinning, even though that field is in fact optional.
Then there's also configuration_aliases which is needed by relatively few people and in most cases irrelevant when introducing a new provider, so completing all 3 attributes also doesn't make much sense.