VladRassokhin / intellij-hcl

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

Incorrect "Unresolved reference" error message #308

Open ALutchko opened 4 years ago

ALutchko commented 4 years ago

Installation details

PyCharm 2020.1.4 (Professional Edition) Build #PY-201.8743.11, built on July 21, 2020 Licensed to xxxxxxxxxxxxx You have a perpetual fallback license for this version Subscription is active until July 6, 2021 Runtime version: 11.0.7+10-b765.65 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1981M Cores: 8 Non-Bundled Plugins: BrowseWordAtCaret, org.intellij.plugins.hcl, mobi.hsz.idea.gitignore, net.seesharpsoft.intellij.plugins.csv

Terraform Configuration Files

According to example 2 in the doc

resource "aws_eks_node_group" "example" {
  scaling_config {
    desired_size = 1
  }
  lifecycle {
    ignore_changes = [scaling_config[0].desired_size]
  }
}

Exception

'desired_size' in lifecycle block is highlighted in red

Unresolved reference desired_size

Expected Behavior

no error found

Actual Behavior

'desired_size' in lifecycle block is highlighted in red like syntax error

Steps to Reproduce

Create a *.tf file, paste the code

corradomatt commented 3 years ago

Issue confirmed. Also, I've noted that if you create a local variable with the unknown property, it will not error...

resource "aws_eks_node_group" "example" {
  scaling_config {
    desired_size = 1
  }
  lifecycle {
    ignore_changes = [scaling_config[0].desired_size] # desired_size will show unresolved reference error
  }
}

locals {
  some_var = scaling_config[0].desired_size # will show NO unresolved reference error
}
Socolin commented 2 years ago

Hello, I have the same issue I think with this:

resource "kubernetes_namespace" "ingress-basic" {
  metadata {
    name   = "ingress-basic"
    labels = {
      "cert-manager.io/disable-validation" = "true"
    }
  }
  lifecycle {
    ignore_changes = [
      metadata[0].labels["kubernetes-dns-label-service"]
    ]
  }
}

image