Skip to content

Add required_providers entry on provider completion #370

Open
@radeksimko

Description

@radeksimko

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions