-
Notifications
You must be signed in to change notification settings - Fork 11
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
Bad highlighting when resource dot number notation is used in template string #40
Comments
Hi @orgads Since this part of highlighting is provided by the TextMate grammars and not by the language server I moved your issue over to the extension repo. There is a chance this may be the same problem as described in hashicorp/vscode-terraform#1040 but I haven't had the time to confirm, so leaving this open until someone has time to confirm. |
Turns out this is a separate issue - we just patched hashicorp/vscode-terraform#1040 upstream and I can still reproduce this: |
While we work on fixing this, I'd also like to point out that more idiomatic way to write the same expression with the same meaning is with square brackets: locals {
a = ["foo"]
}
output "foo" {
value = {
foo = "${local.a[0]}a"
bar = "This is not highlighted as a string"
}
} See also https://www.terraform.io/language/expressions/references#references-to-resource-attributes |
PR with a fix is now pending review in #44 |
Server Version
Terraform Version
Client Version
Terraform Configuration Files
Log Output
https://gist.github.com/orgads/9e2edc3d4ab85de5beaeba113077ae63
Expected Behavior
a
after the closing brace should be highlighted as a string, andbar
should be highlighted as a symbolActual Behavior
Steps to Reproduce
Open VS Code and paste the code above.
Notice that changing
local.a.0
tolocal.a[0]
solves the issue.The text was updated successfully, but these errors were encountered: