|
| 1 | +{ |
| 2 | + "scopeName": "source.bicep", |
| 3 | + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", |
| 4 | + "patterns": [{ "include": "#expression" }, { "include": "#comments" }], |
| 5 | + "repository": { |
| 6 | + "line-comment": { |
| 7 | + "name": "comment.line.double-slash.bicep", |
| 8 | + "match": "//.*(?=$)" |
| 9 | + }, |
| 10 | + "keyword": { |
| 11 | + "name": "keyword.control.declaration.bicep", |
| 12 | + "match": "\\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with)\\b" |
| 13 | + }, |
| 14 | + "object-literal": { |
| 15 | + "begin": "{", |
| 16 | + "end": "}", |
| 17 | + "patterns": [ |
| 18 | + { "include": "#object-property-key" }, |
| 19 | + { "include": "#expression" }, |
| 20 | + { "include": "#comments" } |
| 21 | + ], |
| 22 | + "name": "meta.object-literal.bicep" |
| 23 | + }, |
| 24 | + "string-literal-subst": { |
| 25 | + "begin": "(?<!\\\\)(\\${)", |
| 26 | + "endCaptures": { |
| 27 | + "1": { "name": "punctuation.definition.template-expression.end.bicep" } |
| 28 | + }, |
| 29 | + "end": "(})", |
| 30 | + "patterns": [{ "include": "#expression" }, { "include": "#comments" }], |
| 31 | + "name": "meta.string-literal-subst.bicep", |
| 32 | + "beginCaptures": { |
| 33 | + "1": { |
| 34 | + "name": "punctuation.definition.template-expression.begin.bicep" |
| 35 | + } |
| 36 | + } |
| 37 | + }, |
| 38 | + "array-literal": { |
| 39 | + "begin": "\\[(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\bfor\\b)", |
| 40 | + "end": "]", |
| 41 | + "patterns": [{ "include": "#expression" }, { "include": "#comments" }], |
| 42 | + "name": "meta.array-literal.bicep" |
| 43 | + }, |
| 44 | + "object-property-key": { |
| 45 | + "name": "variable.other.property.bicep", |
| 46 | + "match": "\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*:)" |
| 47 | + }, |
| 48 | + "string-verbatim": { |
| 49 | + "begin": "'''", |
| 50 | + "end": "'''", |
| 51 | + "patterns": [], |
| 52 | + "name": "string.quoted.multi.bicep" |
| 53 | + }, |
| 54 | + "lambda-start": { |
| 55 | + "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]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>)", |
| 56 | + "end": "(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>", |
| 57 | + "name": "meta.lambda-start.bicep", |
| 58 | + "beginCaptures": { |
| 59 | + "1": { |
| 60 | + "name": "meta.undefined.bicep", |
| 61 | + "patterns": [{ "include": "#identifier" }, { "include": "#comments" }] |
| 62 | + } |
| 63 | + } |
| 64 | + }, |
| 65 | + "function-call": { |
| 66 | + "begin": "(\\b[_$[:alpha:]][_$[:alnum:]]*\\b)(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\(", |
| 67 | + "end": "\\)", |
| 68 | + "patterns": [{ "include": "#expression" }, { "include": "#comments" }], |
| 69 | + "name": "meta.function-call.bicep", |
| 70 | + "beginCaptures": { "1": { "name": "entity.name.function.bicep" } } |
| 71 | + }, |
| 72 | + "escape-character": { |
| 73 | + "name": "constant.character.escape.bicep", |
| 74 | + "match": "\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)" |
| 75 | + }, |
| 76 | + "identifier": { |
| 77 | + "name": "variable.other.readwrite.bicep", |
| 78 | + "match": "\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\()" |
| 79 | + }, |
| 80 | + "string-literal": { |
| 81 | + "begin": "'(?!'')", |
| 82 | + "end": "'", |
| 83 | + "patterns": [ |
| 84 | + { "include": "#escape-character" }, |
| 85 | + { "include": "#string-literal-subst" } |
| 86 | + ], |
| 87 | + "name": "string.quoted.single.bicep" |
| 88 | + }, |
| 89 | + "directive-variable": { |
| 90 | + "name": "keyword.control.declaration.bicep", |
| 91 | + "match": "\\b[_a-zA-Z-0-9]+\\b" |
| 92 | + }, |
| 93 | + "directive": { |
| 94 | + "begin": "#\\b[_a-zA-Z-0-9]+\\b", |
| 95 | + "end": "$", |
| 96 | + "patterns": [ |
| 97 | + { "include": "#directive-variable" }, |
| 98 | + { "include": "#comments" } |
| 99 | + ], |
| 100 | + "name": "meta.directive.bicep" |
| 101 | + }, |
| 102 | + "decorator": { |
| 103 | + "begin": "@(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(?=\\b[_$[:alpha:]][_$[:alnum:]]*\\b)", |
| 104 | + "end": "", |
| 105 | + "patterns": [{ "include": "#expression" }, { "include": "#comments" }], |
| 106 | + "name": "meta.decorator.bicep" |
| 107 | + }, |
| 108 | + "block-comment": { |
| 109 | + "name": "comment.block.bicep", |
| 110 | + "begin": "/\\*", |
| 111 | + "end": "\\*/" |
| 112 | + }, |
| 113 | + "comments": { |
| 114 | + "patterns": [ |
| 115 | + { "include": "#line-comment" }, |
| 116 | + { "include": "#block-comment" } |
| 117 | + ] |
| 118 | + }, |
| 119 | + "numeric-literal": { "name": "constant.numeric.bicep", "match": "[0-9]+" }, |
| 120 | + "expression": { |
| 121 | + "patterns": [ |
| 122 | + { "include": "#string-literal" }, |
| 123 | + { "include": "#string-verbatim" }, |
| 124 | + { "include": "#numeric-literal" }, |
| 125 | + { "include": "#named-literal" }, |
| 126 | + { "include": "#object-literal" }, |
| 127 | + { "include": "#array-literal" }, |
| 128 | + { "include": "#keyword" }, |
| 129 | + { "include": "#identifier" }, |
| 130 | + { "include": "#function-call" }, |
| 131 | + { "include": "#decorator" }, |
| 132 | + { "include": "#lambda-start" }, |
| 133 | + { "include": "#directive" } |
| 134 | + ] |
| 135 | + }, |
| 136 | + "named-literal": { |
| 137 | + "name": "constant.language.bicep", |
| 138 | + "match": "\\b(true|false|null)\\b" |
| 139 | + } |
| 140 | + }, |
| 141 | + "name": "Bicep", |
| 142 | + "fileTypes": [".bicep"] |
| 143 | +} |
0 commit comments