Open alexjurkiewicz opened 2 years ago
Hi @alexjurkiewicz Thanks for the report.
Given how complex highlighting is I feel it's appropriate to share some context here.
I know you filed this under the vscode-terraform
repository, so you probably already know this, but I just want to highlight that this is a Terraform-specific problem. Unquoted map keys are what HCL calls "traversals" (basically) and aside from the obvious edge cases with constants like true
or false
, these can have different interpretations depending on the language (e.g. Terraform). See https://go.dev/play/p/l4kYwVbHfZg
There are theoretically two ways we could address this.
hcl-lang
- this means we'd also need to give the library some ability to treat map keys differently based on schema/product and then make use of it somewhere here.Before jumping to solutions though:
Yes, that all makes sense. I hope you can make some progress 🙏
Versions
This bug is reproducible in:
Extension
Language Server
VS Code
Operating System
Terraform Version
Steps To Reproduce
Expected Behavior
I would expect
key_one
andkey_two
to use the same colour, since they are both strings.Actual Behavior
Additional context