language-terraform
language-terraform copied to clipboard
EOF Highlighting Error
The following code does not break the EOF highlighting properly:
policy = <<EOF
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjects",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::${var.bucket_name}/*"
}
]
}
EOF
}
resource "aws_cloudfront_distribution" "distribution" {
Wrong Highlighting

Correct Highlighting
Removing a tab seems to fix highlighting

Is this still an issue in v0.9.3 of this package?
Seems to still be an issue in v0.9.7

I can relate, I recently saw this when the final EOF is not at the beginning of the line.
Reading https://www.terraform.io/language/expressions/strings#indented-heredocs I learned that for <<EOF this is expected. There is an alternative syntax of indented <<-EOF available, did you try that?
Yep, changing to the alternative syntax works, just as removing the indented end marker.
I'll run a sed on our files to fix. Thanks!