File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ moved {
2+ from = " aws_instance.ec2"
3+ to = " aws_instance.ec2[0]"
4+ }
5+
6+ moved {
7+ from = aws_instance. a
8+ to = aws_instance. b
9+ }
10+
11+ moved {
12+ from = aws_instance. a
13+ to = aws_instance. a [" small" ]
14+ }
Original file line number Diff line number Diff line change @@ -102,6 +102,22 @@ patterns:
102102 2 : { name: keyword.operator.assignment.tf }
103103 - include : " #definition-right"
104104
105+ - name : " meta.moved.tf"
106+ begin : ' \b(moved)([\w\-\"$])?(?:\s+)?({)'
107+ beginCaptures :
108+ 1 : { name: keyword.declaration.$1.tf }
109+ 2 : { name: invalid.illegal.keyword.$1.tf }
110+ 3 : { name: punctuation.declaration.block.begin.tf }
111+ end : " }"
112+ endCaptures :
113+ 0 : { name: punctuation.declaration.block.end.tf }
114+ patterns :
115+ - match : ' \b([\-\w]+)(?:\s+)?(=)(?!=|>|<)'
116+ captures :
117+ 1 : { name: variable.other.readwrite.tf }
118+ 2 : { name: keyword.operator.assignment.tf }
119+ - include : " #definition-right"
120+
105121 - name : " meta.module.tf"
106122 begin : ' \b(module)([\w\-\"$])?(?:\s+)?(")?([^\"\n]+)?(")?(?:\s+)?({)'
107123 beginCaptures :
Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ Local values:
4141 ${1:name} = ${2:value}
4242 }
4343
44+ Moved block :
45+ scope : source.tf
46+ prefix : moved
47+ description : Used to refactor or rename existing resources safely.
48+ body : |
49+ moved {
50+ from = "${1:old}"
51+ to = "${2:new}"
52+ }
53+
4454Variable :
4555 scope : source.tf
4656 prefix : variable
You can’t perform that action at this time.
0 commit comments