Recognize inputs and outputs of uninitialized remote (Terraform Registry) modules #599
Closed
2 of 9 tasks
Labels
enhancement
New feature or request
modules
Functionality related to the module block and modules generally
textDocument/completion
textDocument/definition
textDocument/hover
textDocument/references
textDocument/semanticTokens
Semantic syntax highlighting
Use-cases
Users may expect completion, hover, go to definition etc. to work automatically for a
module
block calling any publicly available module they write in their configuration, straight away, e.g.Attempted Solutions / Workarounds
Proposal
Pre-requisites
hashicorp/terraform-ls
GetModuleMetadataFromRegistry
(alongside existing one such asLoadModuleMetadata
) which will talk to the Registry API and cache responses keyed off the source address & version of a Registry module in memdbGetModuleMetadataFromRegistry
is scheduled fromdidOpen
anddidChange
and depends onLoadModuleMetadata
(as that job provides module call metadata)state
: ChangeModuleStore.ModuleMeta(modPath string)
toModuleStore.InstalledModuleMeta(modPath string)
state
: ImplementModuleStore.DeclaredModuleMeta(modCall tfmod.DeclaredModuleCall)
which pulls out any previously cached Registry module metadata from memdbhashicorp/terraform-schema
schema
: IntroduceDeclaredModuleMeta(modCall tfmod.DeclaredModuleCall) (*tfmod.RemoteModuleMeta, error)
schema
: UseDeclaredModuleMeta()
withinSchemaMerger
schema
: For clarity, turnModuleMeta(path string)
intoInstalledModuleMeta(path string)
inModuleReader
interfaceImplementation Notes
https://registry.terraform.io/v1/modules/{FULL_NAME}
curl 'https://registry.terraform.io/v1/modules/terraform-aws-modules/vpc/aws' | jq '.root.inputs[] | select(.required == true)'
The text was updated successfully, but these errors were encountered: