Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOF Highlighting Error #35

Open
petems opened this issue Mar 4, 2018 · 4 comments
Open

EOF Highlighting Error #35

petems opened this issue Mar 4, 2018 · 4 comments
Labels
information needed Issue creator should provide more information/input

Comments

@petems
Copy link

petems commented Mar 4, 2018

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
Copy link
Owner

cmur2 commented Nov 15, 2020

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

@cmur2 cmur2 added the information needed Issue creator should provide more information/input label Nov 15, 2020
@lindeskar
Copy link

Seems to still be an issue in v0.9.7
image

@cmur2
Copy link
Owner

cmur2 commented Mar 23, 2022

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
information needed Issue creator should provide more information/input
Projects
None yet
Development

No branches or pull requests

3 participants