Skip to content
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

Add required_providers entry on provider completion #370

Open
radeksimko opened this issue Jan 6, 2021 · 0 comments
Open

Add required_providers entry on provider completion #370

radeksimko opened this issue Jan 6, 2021 · 0 comments
Labels
enhancement New feature or request providers Functionality related to Terraform providers textDocument/completion

Comments

@radeksimko
Copy link
Member

Current Version

0.12.0

Use-cases

With more providers preloaded in LS 0.12.0 per #341 the user might expect all of these providers to come up as completion candidates here:

provider "<HERE>"

but instead we only list official providers there. The technically correct, although inconvenient logic behind is that these are the only providers which can be used without explicit corresponding entry in required_providers.

Workaround

It is possible to manually add the corresponding entry, for example

terraform {
  required_providers {
    random = {
      source  = "grafana/grafana"
      version = "3.0.0"
    }
  }
}

and completion for provider "<HERE> then contains grafana as a candidate and equally resource and data will complete relevant candidates from the grafana provider.

Proposal

List all preloaded providers when completing provider block label and add the corresponding entry into required_providers block on confirmation automatically.

@radeksimko radeksimko changed the title Add required_providers entry on provider completion Add required_providers entry on provider completion Aug 5, 2021
@xiehan xiehan added the providers Functionality related to Terraform providers label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request providers Functionality related to Terraform providers textDocument/completion
Projects
None yet
Development

No branches or pull requests

2 participants