Add heredoc language injection for HCL

Add a heredoc language injection similar to Ruby for HCL. This allows terraform resources like this to be properly highlighted

```hcl
resource "aws_iam_role" "sample" {
  name               = "sample"
  assume_role_policy = <<JSON
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "AWS": "*"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
JSON
}
```
This commit is contained in:
Roberto Pommella Alegro 2022-07-08 15:29:03 -03:00 committed by Stephan Seitz
parent f0e710793f
commit aac4f027c5

View file

@ -1 +1,7 @@
(comment) @comment
(heredoc_template
(template_literal) @content
(heredoc_identifier) @language
(#set! "language" @language)
(#downcase! "language"))aint that what we do?