| 1 |
{ |
| 2 |
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", |
| 3 |
"name": "bicep", |
| 4 |
"scopeName": "source.bicep", |
| 5 |
"fileTypes": [".bicep"], |
| 6 |
"patterns": [ |
| 7 |
{ |
| 8 |
"include": "#expression" |
| 9 |
}, |
| 10 |
{ |
| 11 |
"include": "#comments" |
| 12 |
} |
| 13 |
], |
| 14 |
"repository": { |
| 15 |
"array-literal": { |
| 16 |
"name": "meta.array-literal.bicep", |
| 17 |
"begin": "\\[(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\bfor\\b)", |
| 18 |
"end": "]", |
| 19 |
"patterns": [ |
| 20 |
{ |
| 21 |
"include": "#expression" |
| 22 |
}, |
| 23 |
{ |
| 24 |
"include": "#comments" |
| 25 |
} |
| 26 |
] |
| 27 |
}, |
| 28 |
"block-comment": { |
| 29 |
"name": "comment.block.bicep", |
| 30 |
"begin": "/\\*", |
| 31 |
"end": "\\*/" |
| 32 |
}, |
| 33 |
"comments": { |
| 34 |
"patterns": [ |
| 35 |
{ |
| 36 |
"include": "#line-comment" |
| 37 |
}, |
| 38 |
{ |
| 39 |
"include": "#block-comment" |
| 40 |
} |
| 41 |
] |
| 42 |
}, |
| 43 |
"decorator": { |
| 44 |
"name": "meta.decorator.bicep", |
| 45 |
"begin": "@(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(?=\\b[_$[:alpha:]][_$[:alnum:]]*\\b)", |
| 46 |
"end": "", |
| 47 |
"patterns": [ |
| 48 |
{ |
| 49 |
"include": "#expression" |
| 50 |
}, |
| 51 |
{ |
| 52 |
"include": "#comments" |
| 53 |
} |
| 54 |
] |
| 55 |
}, |
| 56 |
"directive": { |
| 57 |
"name": "meta.directive.bicep", |
| 58 |
"begin": "#\\b[_a-zA-Z-0-9]+\\b", |
| 59 |
"end": "$", |
| 60 |
"patterns": [ |
| 61 |
{ |
| 62 |
"include": "#directive-variable" |
| 63 |
}, |
| 64 |
{ |
| 65 |
"include": "#comments" |
| 66 |
} |
| 67 |
] |
| 68 |
}, |
| 69 |
"directive-variable": { |
| 70 |
"name": "keyword.control.declaration.bicep", |
| 71 |
"match": "\\b[_a-zA-Z-0-9]+\\b" |
| 72 |
}, |
| 73 |
"escape-character": { |
| 74 |
"name": "constant.character.escape.bicep", |
| 75 |
"match": "\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)" |
| 76 |
}, |
| 77 |
"expression": { |
| 78 |
"patterns": [ |
| 79 |
{ |
| 80 |
"include": "#string-literal" |
| 81 |
}, |
| 82 |
{ |
| 83 |
"include": "#string-verbatim" |
| 84 |
}, |
| 85 |
{ |
| 86 |
"include": "#numeric-literal" |
| 87 |
}, |
| 88 |
{ |
| 89 |
"include": "#named-literal" |
| 90 |
}, |
| 91 |
{ |
| 92 |
"include": "#object-literal" |
| 93 |
}, |
| 94 |
{ |
| 95 |
"include": "#array-literal" |
| 96 |
}, |
| 97 |
{ |
| 98 |
"include": "#keyword" |
| 99 |
}, |
| 100 |
{ |
| 101 |
"include": "#identifier" |
| 102 |
}, |
| 103 |
{ |
| 104 |
"include": "#function-call" |
| 105 |
}, |
| 106 |
{ |
| 107 |
"include": "#decorator" |
| 108 |
}, |
| 109 |
{ |
| 110 |
"include": "#lambda-start" |
| 111 |
}, |
| 112 |
{ |
| 113 |
"include": "#directive" |
| 114 |
} |
| 115 |
] |
| 116 |
}, |
| 117 |
"function-call": { |
| 118 |
"name": "meta.function-call.bicep", |
| 119 |
"begin": "(\\b[_$[:alpha:]][_$[:alnum:]]*\\b)(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\(", |
| 120 |
"beginCaptures": { |
| 121 |
"1": { |
| 122 |
"name": "entity.name.function.bicep" |
| 123 |
} |
| 124 |
}, |
| 125 |
"end": "\\)", |
| 126 |
"patterns": [ |
| 127 |
{ |
| 128 |
"include": "#expression" |
| 129 |
}, |
| 130 |
{ |
| 131 |
"include": "#comments" |
| 132 |
} |
| 133 |
] |
| 134 |
}, |
| 135 |
"identifier": { |
| 136 |
"name": "variable.other.readwrite.bicep", |
| 137 |
"match": "\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\()" |
| 138 |
}, |
| 139 |
"keyword": { |
| 140 |
"name": "keyword.control.declaration.bicep", |
| 141 |
"match": "\\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert|provider)\\b" |
| 142 |
}, |
| 143 |
"lambda-start": { |
| 144 |
"name": "meta.lambda-start.bicep", |
| 145 |
"begin": "(\\((?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(,(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*)*\\)|\\((?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\)|(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*)(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>)", |
| 146 |
"beginCaptures": { |
| 147 |
"1": { |
| 148 |
"name": "meta.undefined.bicep", |
| 149 |
"patterns": [ |
| 150 |
{ |
| 151 |
"include": "#identifier" |
| 152 |
}, |
| 153 |
{ |
| 154 |
"include": "#comments" |
| 155 |
} |
| 156 |
] |
| 157 |
} |
| 158 |
}, |
| 159 |
"end": "(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>" |
| 160 |
}, |
| 161 |
"line-comment": { |
| 162 |
"name": "comment.line.double-slash.bicep", |
| 163 |
"match": "//.*(?=$)" |
| 164 |
}, |
| 165 |
"named-literal": { |
| 166 |
"name": "constant.language.bicep", |
| 167 |
"match": "\\b(true|false|null)\\b" |
| 168 |
}, |
| 169 |
"numeric-literal": { |
| 170 |
"name": "constant.numeric.bicep", |
| 171 |
"match": "[0-9]+" |
| 172 |
}, |
| 173 |
"object-literal": { |
| 174 |
"name": "meta.object-literal.bicep", |
| 175 |
"begin": "{", |
| 176 |
"end": "}", |
| 177 |
"patterns": [ |
| 178 |
{ |
| 179 |
"include": "#object-property-key" |
| 180 |
}, |
| 181 |
{ |
| 182 |
"include": "#expression" |
| 183 |
}, |
| 184 |
{ |
| 185 |
"include": "#comments" |
| 186 |
} |
| 187 |
] |
| 188 |
}, |
| 189 |
"object-property-key": { |
| 190 |
"name": "variable.other.property.bicep", |
| 191 |
"match": "\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*:)" |
| 192 |
}, |
| 193 |
"string-literal": { |
| 194 |
"name": "string.quoted.single.bicep", |
| 195 |
"begin": "'(?!'')", |
| 196 |
"end": "'", |
| 197 |
"patterns": [ |
| 198 |
{ |
| 199 |
"include": "#escape-character" |
| 200 |
}, |
| 201 |
{ |
| 202 |
"include": "#string-literal-subst" |
| 203 |
} |
| 204 |
] |
| 205 |
}, |
| 206 |
"string-literal-subst": { |
| 207 |
"name": "meta.string-literal-subst.bicep", |
| 208 |
"begin": "(?<!\\\\)(\\${)", |
| 209 |
"beginCaptures": { |
| 210 |
"1": { |
| 211 |
"name": "punctuation.definition.template-expression.begin.bicep" |
| 212 |
} |
| 213 |
}, |
| 214 |
"end": "(})", |
| 215 |
"endCaptures": { |
| 216 |
"1": { |
| 217 |
"name": "punctuation.definition.template-expression.end.bicep" |
| 218 |
} |
| 219 |
}, |
| 220 |
"patterns": [ |
| 221 |
{ |
| 222 |
"include": "#expression" |
| 223 |
}, |
| 224 |
{ |
| 225 |
"include": "#comments" |
| 226 |
} |
| 227 |
] |
| 228 |
}, |
| 229 |
"string-verbatim": { |
| 230 |
"name": "string.quoted.multi.bicep", |
| 231 |
"begin": "'''", |
| 232 |
"end": "'''", |
| 233 |
"patterns": [] |
| 234 |
} |
| 235 |
} |
| 236 |
} |
| 237 |
|