pjmiravalle / vscode-terraform-advanced-syntax-highlighting

Terraform Advanced Syntax Highlighting is a Visual Studio Code extension that dramatically improves syntax highlighting for .tf, .tfvars, and .hcl files in VS Code.
https://marketplace.visualstudio.com/items?itemName=pjmiravalle.terraform-advanced-syntax-highlighting
MIT License
12 stars 4 forks source link

"Format()" token syntax highlighting broken when inside square brackets #12

Closed swirle13 closed 4 months ago

swirle13 commented 4 months ago

Small example, with editor tokens and scopes provided.

format(...) is highlighted correctly when by itself image

but when within square brackets, it converts to thinking it is highlighting for image

this behavior does not exist when format is within parentheses or curly braces, only square brackets.

swirle13 commented 4 months ago

I believe the behavior stems from the pattern for "for" lacking the word boundary regexes https://github.com/pjmiravalle/vscode-terraform-advanced-syntax-highlighting/blob/main/syntaxes/terraform.json#L558-L569

After trying and building locally, I can confirm it fixes the issue. image

I'll open a pull request for this, should be a quick, single line fix.

swirle13 commented 4 months ago

@pjmiravalle Figured I'd tag you since your issues don't auto-assign yourself

pjmiravalle commented 4 months ago

Resolved in #13, and released in v1.4.3.