1718a963e6
This is for the core HCL syntax, so it doesn't include any application-specific keyword highlighting, etc. The structural, expression, and template languages are separated into different grammar definitions so that they can be used independently, but they embed each other as needed to complete the language. This is just a first pass, really. There are probably some bugs here, and also some missing features.
97 lines
1.9 KiB
JSON
Executable File
97 lines
1.9 KiB
JSON
Executable File
{
|
|
"fileTypes": [
|
|
"hcl",
|
|
"hcldec"
|
|
],
|
|
"name": "HCL",
|
|
"patterns": [
|
|
{
|
|
"begin": "#|//",
|
|
"captures": {
|
|
"0": {
|
|
"name": "punctuation.definition.comment.hcl"
|
|
}
|
|
},
|
|
"comment": "Comments",
|
|
"end": "$\\n?",
|
|
"name": "comment.line.hcl"
|
|
},
|
|
{
|
|
"begin": "/\\*",
|
|
"captures": {
|
|
"0": {
|
|
"name": "punctuation.definition.comment.hcl"
|
|
}
|
|
},
|
|
"comment": "Block comments",
|
|
"end": "\\*/",
|
|
"name": "comment.block.hcl"
|
|
},
|
|
{
|
|
"begin": "{",
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.block.hcl"
|
|
}
|
|
},
|
|
"comment": "Nested Blocks",
|
|
"end": "}",
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.block.hcl"
|
|
}
|
|
},
|
|
"name": "meta.block.hcl",
|
|
"patterns": [
|
|
{
|
|
"include": "$self"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"captures": {
|
|
"1": {
|
|
"name": "string.hcl punctuation.definition.string.begin.hcl"
|
|
},
|
|
"2": {
|
|
"name": "string.value.hcl"
|
|
},
|
|
"3": {
|
|
"name": "string.hcl punctuation.definition.string.end.hcl"
|
|
}
|
|
},
|
|
"comment": "Quoted Block Labels",
|
|
"match": "(\")([^\"]+)(\")"
|
|
},
|
|
{
|
|
"begin": "(\\w+)\\s*(=)\\s*",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "variable.other.assignment.hcl"
|
|
},
|
|
"2": {
|
|
"name": "keyword.operator.hcl"
|
|
}
|
|
},
|
|
"comment": "Attribute Definitions",
|
|
"end": "$",
|
|
"name": "meta.attr.hcl",
|
|
"patterns": [
|
|
{
|
|
"include": "source.hclexpr"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"captures": {
|
|
"0": {
|
|
"name": "keyword.other.hcl"
|
|
}
|
|
},
|
|
"comment": "Keywords",
|
|
"match": "[-\\w]+"
|
|
}
|
|
],
|
|
"scopeName": "source.hcl",
|
|
"uuid": "55e8075d-e2e3-4e44-8446-744a9860e476"
|
|
} |