vscode-terraform icon indicating copy to clipboard operation
vscode-terraform copied to clipboard

Autocomplete `required_providers` object

Open vinay-menon336 opened this issue 3 years ago • 1 comments

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 terraform_should_be_working

Below screenshot after adding "name" block the the "source" & "value" does not populate
terraform_extension_issue

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

vinay-menon336 avatar Jul 30 '22 19:07 vinay-menon336

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? 2022-08-01 10 25 02

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.

radeksimko avatar Aug 01 '22 09:08 radeksimko