VladRassokhin / intellij-hcl

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

Cloudflare have reused a keyword (`data`) as the name of a block element for `cloudflare_record`, which results in the plugin saying `Missing closing brace on previous line`. #374

Closed rquadling closed 2 years ago

rquadling commented 2 years ago

Cloudflare have reused a keyword (data) as the name of a block element for cloudflare_record, which results in the plugin saying Missing closing brace on previous line.

Prerequisites

v3 of the Terraform Cloudflare Provider

Installation details

Non-Bundled Plugins: some.awesome (1.14) net.vektah.codeglance (1.5.4) net.seesharpsoft.intellij.plugins.csv (2.18.2) net.antelle.intellij-xcode-dark-theme (1.2.4) name.kropp.intellij.makefile (213.5744.224) com.jtschwartz.smartsort (1.0.3) com.jetbrains.darkPurpleTheme (1.2) org.intellij.plugins.hcl (0.7.14) com.hiberbee.intellij.hiberbee-theme (2021.9.23.2312) mobi.hsz.idea.gitignore (4.3.0) de.espend.idea.php.annotation (8.0.0) com.kalessil.phpStorm.phpInspectionsEA (4.0.7.1) izhangzhihao.rainbow.brackets (6.21) ru.adelf.idea.dotenv (2021.3.0.213)

 - [ ] intellij-hcl plugin version (`Settings->Plugins`)

0.7.14

 - [ ] Terraform version (`terraform -v`)

Terraform v1.1.4 on darwin_amd64

Terraform Configuration Files

resource "cloudflare_record" "srv_record" {
  for_each = var.srv_records
  zone_id  = var.cf_zone_id
  type     = "SRV"
  name     = each.value.name

  data {
    service  = each.value.data_service
    proto    = each.value.data_proto
    name     = each.value.data_name
    priority = each.value.data_priority
    weight   = each.value.data_weight
    port     = each.value.data_port
    target   = each.value.data_target
  }
}

Exception

No exception.

Expected Behavior

No red wavy underline for data being used as then name of a block.

Actual Behavior

image

Steps to Reproduce

  1. Create a project with the Cloudflare provider of at least v3.0
  2. Create a file with the resource shown above.
  3. See the red wavy line on data.

The documentation here shows the current structure, and here for the release notices and upgrades needed to move from v2 to v3 of the Cloudflare provider.

VladRassokhin commented 2 years ago

Fixed in 0.7.15 with updated metadata