cmur2 / language-terraform

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

Support indented heredoc string variant that is introduced by the <<- sequence #47

Closed mark-greene closed 2 years ago

mark-greene commented 4 years ago

Terraform accepts an indented heredoc string variant that is introduced by the <<- sequence.

block {
  value = <<-EOT
  hello
    world
  EOT
}

https://www.terraform.io/docs/configuration/expressions.html#string-literals

I saw this was added in 1.9.3 but it is not working for me. Do I need to remove / reinstall?

terraform

mark-greene commented 4 years ago

end: '^\\s*?(\\1)$' seems to fix it.

cmur2 commented 3 years ago

You gave the example (note the 2-spaces indention before the closing EOT) which works fine for me in v0.9.3:

block {
  value = <<-EOT
  hello
    world
  EOT
}

@mark-greene In your screenshot though it looks like the closing EOT is not indented? This would match to the example (notice the opening <<EOT instead of <<-EOT) which also works fine in v0.9.3:

block {
  value = <<EOT
hello
world
EOT
}