`}}/*` treated as comment
I'm using version 0.5.0 of HashiCorp HCL extension and vault policy config but have syntax highlighting issues.
Config:
// For KV storage
path "sample/metadata/project_{{identity.entity.metadata.project_id}}/*" {
capabilities = ["read", "list"]
}
path "sample/data/${var.secrets_base_path}/*" {
capabilities = ["read", "list"]
}
Here is some info that may help:
Hi @nimdeveloper, can you verify that its the HashiCorp HCL extension that is active, and there aren't any other extensions that may be contributing HCL features?
I created a file with an HCL extension and could not reproduce the issue:
That's weird, I also tried on another system, and the same thing happened. I also have the Terraform extension, what I'm doing is that I have some resources for the Vault in my Terraform code. I'm using these policy files using the templatefile func, so basically, I need both extensions as the Terraform extension doesn't support (at least) the syntax highlighting for HCL files. but as soon as I enable the terraform extension, the syntax is broken. Am I doing something wrong here? Shouldn't I install the HCL extension with Terraform? Also, I selected HCL language for these files in VSCode language mode
Thanks for the added context, I misunderstood your use case in your original post. The bad news is, I was able to replicate your experience using that description.
The good news is we have a release slated later this week that will fix the issue for you.
The reason this was occurring is that both the Terraform and HCL extensions ship HCL syntax highlighting, but the fix for this particular issue was not released in the Terraform extension yet. VS Code's extension activation logic is non-deterministic, which means sometimes we do not control which provides functionality at any one point in time. Unfortunately in this case the Terraform extension activated first and provided the older grammar.
v2.32.3 has been released, which includes the latest syntax files. This should fix your issue. Please let us know if it does not.
Thanks.