Skip to content

Commit ddbe28d

Browse files
author
Michael Lyons
committed
Scope AWS patterned blocks somewhat like classes
This is not ideal, but the heuristic works remarkably well.
1 parent bbf1bd0 commit ddbe28d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Terraform.sublime-syntax

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,21 @@ contexts:
598598
#
599599
# https://github.com/hashicorp/hcl2/blob/master/hcl/hclsyntax/spec.md#structural-elements
600600
block:
601+
# Special case heuristic for the two-term ones
602+
- match: (\b({{terraform_known_blocks}})\b\s*(")({{identifier}})(")\s*(")({{identifier}})("))\s*(\{)
603+
captures:
604+
1: meta.type.terraform
605+
2: keyword.declaration.terraform
606+
3: punctuation.definition.begin.terraform
607+
4: support.type.terraform
608+
5: punctuation.definition.end.terraform
609+
6: punctuation.definition.begin.terraform
610+
7: entity.name.type.terraform
611+
8: punctuation.definition.end.terraform
612+
9: punctuation.section.block.begin.terraform
613+
push: block_body
614+
615+
# Generic
601616
- match: (?:\b({{terraform_known_blocks}})\b|({{identifier}}))(?=[\s\"\-[:word:]]*(\{))
602617
captures:
603618
1: keyword.declaration.terraform

0 commit comments

Comments
 (0)