diff --git a/syntaxes/hcl.tmGrammar.json b/syntaxes/hcl.tmGrammar.json index 6781d43..48488b3 100644 --- a/syntaxes/hcl.tmGrammar.json +++ b/syntaxes/hcl.tmGrammar.json @@ -488,7 +488,7 @@ "name": "punctuation.section.parens.begin.hcl" } }, - "end": "(\\))\\s*(\\=)\\s*", + "end": "(\\))\\s*(=|:)\\s*", "endCaptures": { "1": { "name": "punctuation.section.parens.end.hcl" diff --git a/tests/snapshot/hcl/issue809.hcl b/tests/snapshot/hcl/issue809.hcl new file mode 100644 index 0000000..b0257b9 --- /dev/null +++ b/tests/snapshot/hcl/issue809.hcl @@ -0,0 +1,10 @@ +locals { + key_name = "testing" + test_example = { + (local.key_name): "test" + } +} + +variable "test" { + default = "test" +} diff --git a/tests/snapshot/hcl/issue809.hcl.snap b/tests/snapshot/hcl/issue809.hcl.snap new file mode 100644 index 0000000..0c5465f --- /dev/null +++ b/tests/snapshot/hcl/issue809.hcl.snap @@ -0,0 +1,55 @@ +>locals { +#^^^^^^ source.hcl meta.block.hcl entity.name.type.hcl +# ^ source.hcl meta.block.hcl +# ^ source.hcl meta.block.hcl punctuation.section.block.begin.hcl +> key_name = "testing" +#^^ source.hcl meta.block.hcl +# ^^^^^^^^ source.hcl meta.block.hcl variable.declaration.hcl variable.other.readwrite.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl keyword.operator.assignment.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl +# ^ source.hcl meta.block.hcl string.quoted.double.hcl punctuation.definition.string.begin.hcl +# ^^^^^^^ source.hcl meta.block.hcl string.quoted.double.hcl +# ^ source.hcl meta.block.hcl string.quoted.double.hcl punctuation.definition.string.end.hcl +> test_example = { +#^^ source.hcl meta.block.hcl +# ^^^^^^^^^^^^ source.hcl meta.block.hcl variable.declaration.hcl variable.other.readwrite.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl keyword.operator.assignment.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl +# ^ source.hcl meta.block.hcl meta.braces.hcl punctuation.section.braces.begin.hcl +> (local.key_name): "test" +#^^^^^ source.hcl meta.block.hcl meta.braces.hcl meta.mapping.key.hcl punctuation.section.parens.begin.hcl +# ^^^^^ source.hcl meta.block.hcl meta.braces.hcl meta.mapping.key.hcl +# ^ source.hcl meta.block.hcl meta.braces.hcl meta.mapping.key.hcl keyword.operator.accessor.hcl +# ^^^^^^^^ source.hcl meta.block.hcl meta.braces.hcl meta.mapping.key.hcl variable.other.member.hcl +# ^ source.hcl meta.block.hcl meta.braces.hcl meta.mapping.key.hcl punctuation.section.parens.end.hcl +# ^ source.hcl meta.block.hcl meta.braces.hcl meta.mapping.key.hcl keyword.operator.hcl +# ^ source.hcl meta.block.hcl meta.braces.hcl meta.mapping.key.hcl +# ^ source.hcl meta.block.hcl meta.braces.hcl string.quoted.double.hcl punctuation.definition.string.begin.hcl +# ^^^^ source.hcl meta.block.hcl meta.braces.hcl string.quoted.double.hcl +# ^ source.hcl meta.block.hcl meta.braces.hcl string.quoted.double.hcl punctuation.definition.string.end.hcl +> } +#^^ source.hcl meta.block.hcl meta.braces.hcl +# ^ source.hcl meta.block.hcl meta.braces.hcl punctuation.section.braces.end.hcl +>} +#^ source.hcl meta.block.hcl punctuation.section.block.end.hcl +> +>variable "test" { +#^^^^^^^^ source.hcl meta.block.hcl entity.name.type.hcl +# ^ source.hcl meta.block.hcl +# ^^^^^^ source.hcl meta.block.hcl variable.other.enummember.hcl +# ^ source.hcl meta.block.hcl +# ^ source.hcl meta.block.hcl punctuation.section.block.begin.hcl +> default = "test" +#^^ source.hcl meta.block.hcl +# ^^^^^^^ source.hcl meta.block.hcl variable.declaration.hcl variable.other.readwrite.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl keyword.operator.assignment.hcl +# ^ source.hcl meta.block.hcl variable.declaration.hcl +# ^ source.hcl meta.block.hcl string.quoted.double.hcl punctuation.definition.string.begin.hcl +# ^^^^ source.hcl meta.block.hcl string.quoted.double.hcl +# ^ source.hcl meta.block.hcl string.quoted.double.hcl punctuation.definition.string.end.hcl +>} +#^ source.hcl meta.block.hcl punctuation.section.block.end.hcl +> \ No newline at end of file