grammars/source.terraform.json in github-linguist-5.3.3 vs grammars/source.terraform.json in github-linguist-6.0.0
- old
+ new
@@ -1,57 +1,44 @@
{
"name": "Terraform",
"scopeName": "source.terraform",
- "fileTypes": [
- "tf",
- "tfvars",
- "hcl"
- ],
- "uuid": "9060ca81-906d-4f19-a91a-159f4eb119d6",
"patterns": [
{
- "comment": "Comments",
"name": "comment.line.number-sign.terraform",
"begin": "#|//",
"end": "$\\n?",
"captures": {
"0": {
"name": "punctuation.definition.comment.terraform"
}
}
},
{
- "comment": "Block comments",
"name": "comment.block.terraform",
"begin": "/\\*",
"end": "\\*/",
"captures": {
"0": {
"name": "punctuation.definition.comment.terraform"
}
}
},
{
- "comment": "Language constants (true, false, yes, no, on, off)",
"name": "constant.language.terraform",
"match": "\\b(true|false|yes|no|on|off)\\b"
},
{
- "comment": "Numbers",
"name": "constant.numeric.terraform",
"match": "\\b([0-9]+)([kKmMgG]b?)?\\b"
},
{
- "comment": "Hex numbers",
"name": "constant.numeric.terraform",
"match": "\\b(0x[0-9A-Fa-f]+)([kKmMgG]b?)?\\b"
},
{
"name": "meta.resource.terraform",
"match": "(resource|data)\\s+(\")?(\\w+)(\")?\\s+(\")?([\\w\\-]+)(\")?\\s+({)",
- "foldingStartMarker": "\\{\\s*$",
- "foldingStopMarker": "^\\s*\\}",
"captures": {
"1": {
"name": "storage.type.function.terraform"
},
"2": {
@@ -77,12 +64,10 @@
}
}
},
{
"match": "(provider|provisioner|variable|output|module|atlas)\\s+(\")?([\\w\\-]+)(\")?\\s+({)",
- "foldingStartMarker": "\\{\\s*$",
- "foldingStopMarker": "^\\s*\\}",
"captures": {
"1": {
"name": "storage.type.function.terraform"
},
"2": {
@@ -98,11 +83,10 @@
"name": "punctuation.definition.tag.terraform"
}
}
},
{
- "comment": "Value assignments (left hand side not in double quotes)",
"match": "([\\w_-]+)\\s*(=)\\s*",
"captures": {
"1": {
"name": "variable.other.assignment.terraform"
},
@@ -110,11 +94,10 @@
"name": "keyword.operator.terraform"
}
}
},
{
- "comment": "Value assignments (left hand side in double quotes)",
"match": "(\")([\\w_-]+)(\")\\s*(=)\\s*",
"captures": {
"1": {
"name": "punctuation.quote.double.terraform"
},
@@ -128,11 +111,10 @@
"name": "keyword.operator.terraform"
}
}
},
{
- "comment": "Maps",
"match": "([\\w\\-_]+)\\s+({)",
"captures": {
"1": {
"name": "entity.name.section.terraform"
},
@@ -144,124 +126,122 @@
{
"include": "#strings"
},
{
"name": "string.unquoted.heredoc.terraform",
- "begin": "(?>\\s*<<(\\w+))",
+ "begin": "(?\u003e\\s*\u003c\u003c(\\w+))",
+ "end": "^\\s*\\1$",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.terraform"
},
"1": {
"name": "keyword.operator.heredoc.terraform"
}
},
- "end": "^\\s*\\1$",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.terraform keyword.operator.heredoc.terraform"
}
}
}
],
"repository": {
- "strings": {
- "comment": "Strings",
- "begin": "\\\"",
- "beginCaptures": {
- "0": {
- "name": "string.terraform punctuation.definition.string.begin.terraform"
- }
- },
- "end": "\\\"",
- "endCaptures": {
- "0": {
- "name": "string.terraform punctuation.definition.string.end.terraform"
- }
- },
+ "string_interpolation": {
"patterns": [
{
- "include": "#string_interpolation"
- },
- {
- "match": "([\\w\\-\\/\\._\\\\%]+)",
- "name": "string.quoted.double.terraform"
+ "name": "source.terraform.embedded.source",
+ "begin": "\\$\\{",
+ "end": "\\}",
+ "patterns": [
+ {
+ "include": "$self"
+ },
+ {
+ "include": "#string_interpolation_functions"
+ },
+ {
+ "include": "#string_interpolation_keywords"
+ },
+ {
+ "match": "(\\.)",
+ "captures": {
+ "0": {
+ "name": "keyword.control.period.terraform"
+ }
+ }
+ },
+ {
+ "include": "#strings"
+ }
+ ],
+ "beginCaptures": {
+ "0": {
+ "name": "entity.tag.embedded.start.terraform"
+ }
+ },
+ "endCaptures": {
+ "0": {
+ "name": "entity.tag.embedded.end.terraform"
+ }
+ }
}
]
},
"string_interpolation_functions": {
- "comment": "Builtin functions",
"begin": "(base64decode|base64encode|base64gzip|base64sha256|base64sha512|basename|bcrypt|ceil|chomp|cidrhost|cidrnetmask|cidrsubnet|coalesce|coalescelist|compact|concat|contains|dirname|distinct|element|file|flatten|floor|format|formatlist|index|join|jsonencode|keys|length|list|log|lookup|lower|map|matchkeys|max|md5|merge|min|pathexpand|pow|replace|sha1|sha256|sha512|signum|slice|sort|split|substr|timestamp|title|trimspace|upper|urlencode|uuid|values|zipmap)(\\()",
+ "end": "(\\))",
+ "patterns": [
+ {
+ "include": "#string_interpolation_functions"
+ },
+ {
+ "include": "#string_interpolation_keywords"
+ }
+ ],
"beginCaptures": {
"1": {
"name": "keyword.other.function.inline.terraform"
},
"2": {
"name": "keyword.other.section.begin.terraform"
}
},
- "end": "(\\))",
"endCaptures": {
"1": {
"name": "keyword.other.section.end.terraform"
}
- },
- "patterns": [
- {
- "include": "#string_interpolation_functions"
- },
- {
- "include": "#string_interpolation_keywords"
- }
- ]
+ }
},
"string_interpolation_keywords": {
"match": "(terraform|var|self|count|module|path|data)(\\.[\\w\\*]+)+",
"captures": {
"0": {
"name": "entity.other.attribute-name.terraform"
}
}
},
- "string_interpolation": {
+ "strings": {
+ "begin": "\\\"",
+ "end": "\\\"",
"patterns": [
{
- "name": "source.terraform.embedded.source",
- "begin": "\\$\\{",
- "beginCaptures": {
- "0": {
- "name": "entity.tag.embedded.start.terraform"
- }
- },
- "end": "\\}",
- "endCaptures": {
- "0": {
- "name": "entity.tag.embedded.end.terraform"
- }
- },
- "patterns": [
- {
- "include": "$self"
- },
- {
- "include": "#string_interpolation_functions"
- },
- {
- "include": "#string_interpolation_keywords"
- },
- {
- "match": "(\\.)",
- "captures": {
- "0": {
- "name": "keyword.control.period.terraform"
- }
- }
- },
- {
- "include": "#strings"
- }
- ]
+ "include": "#string_interpolation"
+ },
+ {
+ "name": "string.quoted.double.terraform",
+ "match": "([\\w\\-\\/\\._\\\\%]+)"
}
- ]
+ ],
+ "beginCaptures": {
+ "0": {
+ "name": "string.terraform punctuation.definition.string.begin.terraform"
+ }
+ },
+ "endCaptures": {
+ "0": {
+ "name": "string.terraform punctuation.definition.string.end.terraform"
+ }
+ }
}
}
-}
\ No newline at end of file
+}