VladRassokhin / intellij-hcl

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

Support optional keyword and other terraform 1.0 language enhancements #338

Closed samart closed 3 years ago

samart commented 3 years ago

Support optional keyword for variables. recognize tomap and tolist functions

VladRassokhin commented 3 years ago

What is "optional keyword for variables"? tomap and tolist supported in 0.7.11

haidaraM commented 3 years ago

optional experimental keyword is defined here: https://www.terraform.io/docs/language/expressions/type-constraints.html#experimental-optional-object-type-attributes.

There is also a defaults experimental function: https://www.terraform.io/docs/language/functions/defaults.html. Not sure if it's supported or not

VladRassokhin commented 3 years ago

Fixed optional in 0.7.14 defaults is somehow works.

mrlexor commented 1 year ago

Hello,

I've found out this closed issue regarding optional modifier. It's actually work, but not as expected.

Optional modifier has two arguments and if I use it only with as shown one, so linter shows that okay:

Screenshot 2022-10-18 at 14 53 53

However, when I add the second one, default argument, linter, seems, doesn't know about it:

Screenshot 2022-10-18 at 14 58 04

Can you take a look, please?

Here you may find information about default argument for the optional modifier.