cmur2 / language-terraform

Terraform.io support for Atom
MIT License
49 stars 32 forks source link

EOF Highlighting Error #35

Open petems opened 6 years ago

petems commented 6 years ago

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

screenshot1

Correct Highlighting

Removing a tab seems to fix highlighting

screenshot2

cmur2 commented 4 years ago

Is this still an issue in v0.9.3 of this package?

lindeskar commented 2 years ago

Seems to still be an issue in v0.9.7 image

cmur2 commented 2 years ago

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?

lindeskar commented 2 years ago

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!