Skip to content

earlydecoder: Decode unknown modules & provider requirements #108

@radeksimko

Description

@radeksimko

Currently we decode all module calls into a map, where the key is the module reference name and ignore any module calls which do not have a reference name + override modules of the same name.

module "" {
  source = ""
}

module "" {
  source = ""
}

Similarly we decode required providers into a map, keyed off provider local name and override any requirements with the same name.

terraform {
  required_providers {
    name = {
      source = ""
    }
    name = {
      source = ""
    }
  }
}

Map of course makes lookups much easier, but it makes it practically impossible to track unknown modules and provide some IntelliSense within those.

For module calls in particular map is a reasonable structure for hashicorp/terraform-ls#598 and hashicorp/terraform-ls#725 but unnamed modules may also be helpful to parse in the context of hashicorp/terraform-ls#869

Similarly hashicorp/terraform-ls#871 may benefit from decoded requirements of the same name.

Originally posted by @radeksimko in #106 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions