VladRassokhin / intellij-hcl

HCL language support for IntelliJ platform based IDEs
Apache License 2.0
244 stars 47 forks source link

Terraform TypeMaps are incorrectly formatted #260

Closed benosman closed 5 years ago

benosman commented 5 years ago

Thank you for opening an issue. In this template paragraph text could be removed, however please retain headers.

Prerequisites

Installation details

Expected Behavior

The autocomplete should insert TypeMap declared items into the code as arguments like below:

triggers = {
    serial = "2019-09-20"
}

tags = {
  environment = "develop"
}

Actual Behavior

The autocomplete should insert TypeMap declared items into the code as blocks, which fail in terraform apply with an error.

triggers {
    serial = "2019-09-20"
}

tags {
  environment = "develop"
}

Error

Blocks of type "<name>" are not expected here. Did you mean to define argument "<name>"? If so, use the equals sign to assign it a value.

Additionally, if you manually add the equals sign to make it work, from then on the HCL plugin does not recognise that map's subkeys in the autocompletion popup.

benosman commented 5 years ago

There is another related issue for an older version: https://github.com/VladRassokhin/intellij-hcl/issues/233

VladRassokhin commented 5 years ago

Closing as duplicate of #233