Terraform.tmLanguage icon indicating copy to clipboard operation
Terraform.tmLanguage copied to clipboard

IAM policy with */ treated as commend block

Open lczerepuk opened this issue 4 years ago • 4 comments

Hi,

In ST3 when I have a IAM policy with "/*", plugin treated this as comment:

Zrzut ekranu 2021-01-13 o 11 22 29

For example, in Visual Studio its workings good:

Zrzut ekranu 2021-01-13 o 11 25 47

Can you fix it ? I love ST3 and Your plugin, but this bug is very annoying. ;(

lczerepuk avatar Jan 13 '21 10:01 lczerepuk

I fixed this by doing a manual install of the plugin via cloning the repo (see instructions on readme) and commenting out lines 170-178 of Terraform.sublime-syntax. Not submitting a PR because this is a quick hack to fix it enough to suit my needs. I have many IAM s3 policies and I don't use block comments, but others might.

jtcastillo avatar Jun 04 '21 17:06 jtcastillo

I’d be happy to take this on if someone could give me some guidance. I’m sure the Java syntax handles this problem, I just don’t know where to look.

hermitmaster avatar Jun 06 '21 19:06 hermitmaster

I'm also seeing broken syntax inside of jsonencode() with the variable expansion syntax ("${}").

ryanpcmcquen avatar Jun 07 '21 20:06 ryanpcmcquen

I found a workaround for this. Remove the quotes from all of the keys and use = instead of :

hermitmaster avatar Jun 16 '21 00:06 hermitmaster