| 1 | { |
| 2 | "name": "ASP.NET Razor", |
| 3 | "scopeName": "text.html.cshtml", |
| 4 | "fileTypes": ["cshtml", "gohtml"], |
| 5 | "patterns": [ |
| 6 | { |
| 7 | "name": "section.embedded.source.cshtml", |
| 8 | "begin": "(@?([a-zA-Z0-9]+)?)(\\s[a-zA-Z0-9]+)?(\n|\r)?(\\{)", |
| 9 | "beginCaptures": { |
| 10 | "0": { |
| 11 | "name": "punctuation.section.embedded.begin.cshtml" |
| 12 | }, |
| 13 | "1": { |
| 14 | "name": "keyword.control.cshtml" |
| 15 | } |
| 16 | }, |
| 17 | "patterns": [ |
| 18 | { |
| 19 | "name": "section.embedded.source.cshtml", |
| 20 | "begin": "(@?([a-zA-Z0-9]+)?)(\\s[a-zA-Z0-9]+)?(\n|\r)?(\\{)", |
| 21 | "beginCaptures": { |
| 22 | "0": { |
| 23 | "name": "punctuation.section.embedded.begin.cshtml" |
| 24 | }, |
| 25 | "1": { |
| 26 | "name": "keyword.control.cshtml" |
| 27 | } |
| 28 | }, |
| 29 | "patterns": [ |
| 30 | { |
| 31 | "name": "string.quoted.single.cshtml", |
| 32 | "match": "'" |
| 33 | }, |
| 34 | { |
| 35 | "include": "#embedded-code" |
| 36 | }, |
| 37 | { |
| 38 | "include": "#comments" |
| 39 | }, |
| 40 | { |
| 41 | "include": "source.cs" |
| 42 | }, |
| 43 | { |
| 44 | "include": "text.html.basic" |
| 45 | } |
| 46 | ], |
| 47 | "end": "\\}", |
| 48 | "endCaptures": { |
| 49 | "0": { |
| 50 | "name": "punctuation.section.embedded.begin.cshtml" |
| 51 | } |
| 52 | } |
| 53 | }, |
| 54 | { |
| 55 | "name": "string.quoted.single.cshtml", |
| 56 | "match": "'" |
| 57 | }, |
| 58 | { |
| 59 | "include": "#embedded-code" |
| 60 | }, |
| 61 | { |
| 62 | "include": "#comments" |
| 63 | }, |
| 64 | { |
| 65 | "include": "text.html.basic" |
| 66 | } |
| 67 | ], |
| 68 | "end": "\\}", |
| 69 | "endCaptures": { |
| 70 | "0": { |
| 71 | "name": "punctuation.section.embedded.begin.cshtml" |
| 72 | } |
| 73 | }, |
| 74 | "comments": "Simple multi-line code section" |
| 75 | }, |
| 76 | { |
| 77 | "begin": "(@[a-zA-Z0-9]+)(\\s?)", |
| 78 | "captures": { |
| 79 | "0": { |
| 80 | "name": "section.embedded.begin.cshtml" |
| 81 | }, |
| 82 | "1": { |
| 83 | "name": "keyword.control.cshtml" |
| 84 | } |
| 85 | }, |
| 86 | "patterns": [ |
| 87 | { |
| 88 | "match": "(([a-zA-Z0-9]+)(\\.)?)+?", |
| 89 | "captures": { |
| 90 | "2": { |
| 91 | "name": "entity.name.tag.source.cshtml" |
| 92 | }, |
| 93 | "3": { |
| 94 | "name": "punctuation.separator.namespace.source.cshtml" |
| 95 | } |
| 96 | } |
| 97 | }, |
| 98 | { |
| 99 | "include": "#embedded-code" |
| 100 | }, |
| 101 | { |
| 102 | "include": "#comments" |
| 103 | }, |
| 104 | { |
| 105 | "include": "source.cs" |
| 106 | }, |
| 107 | { |
| 108 | "include": "text.html.basic" |
| 109 | } |
| 110 | ], |
| 111 | "end": "(\\n|\\s)", |
| 112 | "comments": "Covers single line Razor tags" |
| 113 | }, |
| 114 | { |
| 115 | "include": "#comments" |
| 116 | }, |
| 117 | { |
| 118 | "include": "text.html.basic" |
| 119 | } |
| 120 | ], |
| 121 | "repository": { |
| 122 | "embedded-code": { |
| 123 | "match": "(@?[a-zA-Z0-9]+)(\\.([a-zA-Z0-9]+))?", |
| 124 | "captures": { |
| 125 | "1": { |
| 126 | "name": "keyword.control.cshtml" |
| 127 | }, |
| 128 | "3": { |
| 129 | "name": "entity.name.tag.source.cshtml" |
| 130 | } |
| 131 | }, |
| 132 | "patterns": [ |
| 133 | { |
| 134 | "include": "#comments" |
| 135 | } |
| 136 | ] |
| 137 | }, |
| 138 | "comments": { |
| 139 | "begin": "@\\*", |
| 140 | "captures": { |
| 141 | "0": { |
| 142 | "name": "punctuation.definition.comment.source.cshtml" |
| 143 | } |
| 144 | }, |
| 145 | "end": "\\*@", |
| 146 | "name": "comment.block.cshtml" |
| 147 | } |
| 148 | }, |
| 149 | "version": "https://github.com/demyte/language-cshtml/commit/a49735dc7aef56ae772a3bcfd8e42c89895dcff4" |
| 150 | } |