fd / language-hcl

A grammar for the HashiCorp Configuration Language.
MIT License
12 stars 7 forks source link

Hash Block Not Properly Supported #9

Open darkn3rd opened 6 years ago

darkn3rd commented 6 years ago

Proper HCL hash blocks documented from Hashicorp are flagged as an error.

STEPS

Create a block like this below:

  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-8"
    }
  }

This snippet came from: https://www.terraform.io/docs/providers/google/r/compute_instance.html

ACTUAL RESULTS

The second brace after initialize_params is highlighted in red.

EXPECTED RESULTS

The second parameter would not be flagged and highlighted. There is an implicit equals in the current HCL language.

WORKAROUND

You have to explicitly add the =. This will make the code inconsistent with current Hashicorp documentation.

  boot_disk {
    initialize_params = {
      image = "debian-cloud/debian-8"
    }
  }