[x] Ensure you have latest version of plugin installed
[x] Search for possible issue duplicates
Maybe #281?
Installation details
[x] IDE version (Help->About->Copy to Clipboard)
PyCharm 2020.3.4 (Community Edition)
Build #PC-203.7717.65, built on March 17, 2021
Runtime version: 11.0.10+8-b1145.96 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.8.0-48-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 2966M
Cores: 4
Non-Bundled Plugins: org.intellij.plugins.hcl, Docker, org.toml.lang
Current Desktop: ubuntu:GNOME
[x] intellij-hcl plugin version (Settings->Plugins)
0.7.10
locals {
object_items = [
{
a = "1"
b = "2"
},
{
a = "3"
b = "4"
}
]
as_map = {
for item in local.object_items : "key-${item.a}" => "value-${item.b}" # <-- errors here
}
as_list = [
for item in local.object_items : "just-${item.a}" # <-- error here
]
list_items = [["a"], ["b"], ["c"]]
as_list2 = [
for item in local.list_items : "text-${item[0]}" # <-- error here
]
}
Expected Behavior
All of this code should be accepted as valid (Terraform itself is happy with it)
Actual Behavior
The interpolations in the strings are marked as errors, specifically Unknown resource type on the item tokens and Unresolved reference a/b on the a/b attributes.
When these attributes (or indices) are accessed directly (without being in a string interpolation), no errors are shown, it all works fine.
Steps to Reproduce
Paste the above snippet into a .tf file (not a scratch file - for some reason the errors are not reported there)
Prerequisites
Installation details
[x] IDE version (
Help->About->Copy to Clipboard
) PyCharm 2020.3.4 (Community Edition) Build #PC-203.7717.65, built on March 17, 2021 Runtime version: 11.0.10+8-b1145.96 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.8.0-48-generic GC: ParNew, ConcurrentMarkSweep Memory: 2966M Cores: 4 Non-Bundled Plugins: org.intellij.plugins.hcl, Docker, org.toml.lang Current Desktop: ubuntu:GNOME[x] intellij-hcl plugin version (
Settings->Plugins
) 0.7.10[x] Terraform version (
terraform -v
)Terraform Configuration Files
Expected Behavior
All of this code should be accepted as valid (Terraform itself is happy with it)
Actual Behavior
The interpolations in the strings are marked as errors, specifically
Unknown resource type
on theitem
tokens andUnresolved reference a/b
on thea
/b
attributes.When these attributes (or indices) are accessed directly (without being in a string interpolation), no errors are shown, it all works fine.
Steps to Reproduce
.tf
file (not a scratch file - for some reason the errors are not reported there)