Skip to content

Commit 13c0d8a

Browse files
committed
Move comments to a prototype context
1 parent e03a17e commit 13c0d8a

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

Terraform.sublime-syntax

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,10 @@ variables:
166166
)
167167
168168
contexts:
169-
main:
169+
prototype:
170170
- include: comments
171+
172+
main:
171173
- include: attribute-definition
172174
- include: imports
173175
- include: blocks
@@ -306,6 +308,7 @@ contexts:
306308
push: string-body
307309

308310
string-body:
311+
- meta_include_prototype: false
309312
- meta_scope: meta.string.terraform string.quoted.double.terraform
310313
- match: \"
311314
scope: punctuation.definition.string.end.terraform

tests/syntax_test_scope.tf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,17 @@
240240
# ^ punctuation.definition.string.end.terraform
241241
# ^ - punctuation - string
242242

243+
/////
244+
// Does not include comments.
245+
/////
246+
247+
"a string // with double-slash"
248+
# ^ - punctuation - string
249+
# ^ punctuation.definition.string.begin.terraform
250+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.terraform
251+
# ^ punctuation.definition.string.end.terraform
252+
# ^ - punctuation - string
253+
243254
/////
244255
// Matches character escapes.
245256
/////
@@ -1306,6 +1317,31 @@
13061317
# ^ punctuation.accessor.dot.terraform
13071318
# ^^^^^^^^^^^^ variable.other.member.terraform
13081319

1320+
/////
1321+
// Parenthesized assignment
1322+
/////
1323+
1324+
attribute = (
1325+
# ^^^^^^^^^ variable.declaration.terraform variable.other.readwrite.terraform
1326+
# ^ keyword.operator.assignment.terraform
1327+
# ^^ meta.parens.terraform
1328+
# ^ punctuation.section.parens.begin.terraform
1329+
local.var1 != ""
1330+
? local.var1
1331+
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.parens.terraform
1332+
# ^ keyword.operator.ternary.terraform
1333+
# ^^^^^ variable.language.terraform
1334+
# ^ punctuation.accessor.dot.terraform
1335+
# ^^^^ variable.other.member.terraform
1336+
// A comment
1337+
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.parens.terraform
1338+
# ^^^^^^^^^^^^^ comment.line.terraform
1339+
# ^^ punctuation.definition.comment.terraform
1340+
# ^ punctuation.definition.comment.terraform
1341+
: uuidv4()
1342+
)
1343+
#^^^^^^ meta.parens.terraform
1344+
# ^ punctuation.section.parens.end.terraform
13091345

13101346
/////
13111347
// Meta-arguments

0 commit comments

Comments
 (0)