hashicorp / syntax

TextMate grammars for highlighting HCL, HCL-based languages and Sentinel.
Mozilla Public License 2.0
25 stars 11 forks source link

Fix mis-highlight for conditionals detected as a block #116

Closed dbanck closed 6 months ago

dbanck commented 6 months ago

Looking at the screenshots from #115, I noticed that the local keyword was highlighted in a different way than in the current vscode-hcl grammar.

I traced this back to #94, which changed the recognition of blocks. I made this a little less permissive by disallowing ? in block labels. This fixes the case where a ternary operator followed by an object is recognized as a block.

CleanShot 2024-03-25 at 18 07 56@2x

UX Before

CleanShot 2024-03-25 at 18 28 16@2x

UX After

CleanShot 2024-03-25 at 18 27 32@2x