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