mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
513 lines
11 KiB
JSON
513 lines
11 KiB
JSON
{
|
|
"information_for_contributors": [
|
|
"This file has been converted from https://github.com/demyte/language-cshtml/blob/master/grammars/cshtml.json",
|
|
"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."
|
|
],
|
|
"version": "https://github.com/demyte/language-cshtml/commit/cbf0e35971324e861247145e92f4cbbe0bc42d0e",
|
|
"name": "ASP.NET Razor",
|
|
"scopeName": "text.html.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": "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": [
|
|
{
|
|
"include": "#embedded-code"
|
|
},
|
|
{
|
|
"include": "#general-includes"
|
|
},
|
|
{
|
|
"include": "source.cs"
|
|
}
|
|
],
|
|
"end": "\\}",
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "punctuation.section.embedded.begin.cshtml"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"include": "#embedded-code"
|
|
},
|
|
{
|
|
"include": "#general-includes"
|
|
},
|
|
{
|
|
"include": "source.cs"
|
|
}
|
|
],
|
|
"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": "#general-includes"
|
|
}
|
|
],
|
|
"end": "(\\n|\\s)",
|
|
"comments": "Single statement Razor tags"
|
|
},
|
|
{
|
|
"begin": "(@\\()",
|
|
"captures": {
|
|
"0": {
|
|
"name": "punctuation.section.embedded.begin.cshtml"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"include": "#embedded-code"
|
|
},
|
|
{
|
|
"include": "#general-includes"
|
|
},
|
|
{
|
|
"include": "source.cs"
|
|
}
|
|
],
|
|
"end": "(\\))",
|
|
"comments": "Covers same line Razor statments with embedded C#"
|
|
},
|
|
{
|
|
"begin": "(^[ \\t]+)?(?=<(?i:script))",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.whitespace.embedded.leading.html"
|
|
}
|
|
},
|
|
"end": "(?!\\G)([ \\t]*$\\n?)?",
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.whitespace.embedded.trailing.html"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"begin": "(<)((?i:script))\\b",
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "meta.tag.metadata.script.html"
|
|
},
|
|
"1": {
|
|
"name": "punctuation.definition.tag.begin.html"
|
|
},
|
|
"2": {
|
|
"name": "entity.name.tag.html"
|
|
}
|
|
},
|
|
"end": "(/>)|(/)((?i:script))(>)",
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "meta.tag.metadata.script.html"
|
|
},
|
|
"1": {
|
|
"name": "punctuation.definition.tag.end.html"
|
|
},
|
|
"2": {
|
|
"name": "punctuation.definition.tag.begin.html"
|
|
},
|
|
"3": {
|
|
"name": "entity.name.tag.html"
|
|
},
|
|
"4": {
|
|
"name": "punctuation.definition.tag.end.html"
|
|
}
|
|
},
|
|
"name": "meta.embedded.block.html",
|
|
"patterns": [
|
|
{
|
|
"begin": "\\G",
|
|
"end": "(?=/>|/)",
|
|
"patterns": [
|
|
{
|
|
"begin": "(>)",
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "meta.tag.metadata.script.html"
|
|
},
|
|
"1": {
|
|
"name": "punctuation.definition.tag.end.html"
|
|
}
|
|
},
|
|
"end": "((<))(?=/(?i:script))",
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "meta.tag.metadata.script.html"
|
|
},
|
|
"1": {
|
|
"name": "punctuation.definition.tag.begin.html"
|
|
},
|
|
"2": {
|
|
"name": "source.js"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"begin": "\\G",
|
|
"end": "(?=</(?i:script))",
|
|
"name": "source.js",
|
|
"patterns": [
|
|
{
|
|
"begin": "(^[ \\t]+)?(?=//)",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.whitespace.comment.leading.js"
|
|
}
|
|
},
|
|
"end": "(?!\\G)",
|
|
"patterns": [
|
|
{
|
|
"begin": "//",
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "punctuation.definition.comment.js"
|
|
}
|
|
},
|
|
"end": "(?=</script)|\\n",
|
|
"name": "comment.line.double-slash.js"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "/\\*",
|
|
"captures": {
|
|
"0": {
|
|
"name": "punctuation.definition.comment.js"
|
|
}
|
|
},
|
|
"end": "\\*/|(?=</script)",
|
|
"name": "comment.block.js"
|
|
},
|
|
{
|
|
"include": "source.js"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "\\G",
|
|
"end": "(?i:(?=/?>|type(?=[\\s=])(?!\\s*=\\s*('|\"|)(text/(javascript|ecmascript|babel)|application/((x-)?javascript|ecmascript|babel)|module)[\\s\"'>])))",
|
|
"name": "meta.tag.metadata.script.html",
|
|
"patterns": [
|
|
{
|
|
"include": "#tag-stuff"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "(?=(?i:type\\s*=\\s*('|\"|)(text/(x-handlebars|(x-(handlebars-)?|ng-)?template|html)[\\s\"'>])))",
|
|
"end": "((<))(?=/(?i:script))",
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "meta.tag.metadata.script.html"
|
|
},
|
|
"1": {
|
|
"name": "punctuation.definition.tag.begin.html"
|
|
},
|
|
"2": {
|
|
"name": "text.html.cshtml"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"begin": "\\G",
|
|
"end": "(>)|(?=/>)",
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.tag.end.html"
|
|
}
|
|
},
|
|
"name": "meta.tag.metadata.script.html",
|
|
"patterns": [
|
|
{
|
|
"include": "#tag-stuff"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "(?!\\G)",
|
|
"end": "(?=</(?i:script))",
|
|
"name": "text.html.cshtml",
|
|
"patterns": [
|
|
{
|
|
"include": "text.html.cshtml"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "(?=(?i:type))",
|
|
"end": "(<)(?=/(?i:script))",
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "meta.tag.metadata.script.html"
|
|
},
|
|
"1": {
|
|
"name": "punctuation.definition.tag.begin.html"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"begin": "\\G",
|
|
"end": "(>)|(?=/>)",
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.definition.tag.end.html"
|
|
}
|
|
},
|
|
"name": "meta.tag.metadata.script.html",
|
|
"patterns": [
|
|
{
|
|
"include": "#tag-stuff"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "(?!\\G)",
|
|
"end": "(?=</(?i:script))",
|
|
"name": "source.unknown"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "(^[ \\t]+)?(?=<(?i:style))",
|
|
"beginCaptures": {
|
|
"1": {
|
|
"name": "punctuation.whitespace.embedded.leading.html"
|
|
}
|
|
},
|
|
"end": "(?!\\G)([ \\t]*$\\n?)?",
|
|
"endCaptures": {
|
|
"1": {
|
|
"name": "punctuation.whitespace.embedded.trailing.html"
|
|
}
|
|
},
|
|
"patterns": [
|
|
{
|
|
"begin": "(<)((?i:style))\\b",
|
|
"beginCaptures": {
|
|
"0": {
|
|
"name": "meta.tag.metadata.style.html"
|
|
},
|
|
"1": {
|
|
"name": "punctuation.definition.tag.begin.html"
|
|
},
|
|
"2": {
|
|
"name": "entity.name.tag.html"
|
|
}
|
|
},
|
|
"end": "(/>)|((<)/)((?i:style))(>)",
|
|
"endCaptures": {
|
|
"0": {
|
|
"name": "meta.tag.metadata.style.html"
|
|
},
|
|
"1": {
|
|
"name": "punctuation.definition.tag.end.html"
|
|
},
|
|
"2": {
|
|
"name": "punctuation.definition.tag.begin.html"
|
|
},
|
|
"3": {
|
|
"name": "source.css"
|
|
},
|
|
"4": {
|
|
"name": "entity.name.tag.html"
|
|
},
|
|
"5": {
|
|
"name": "punctuation.definition.tag.end.html"
|
|
}
|
|
},
|
|
"name": "meta.embedded.block.html",
|
|
"patterns": [
|
|
{
|
|
"begin": "\\G",
|
|
"captures": {
|
|
"1": {
|
|
"name": "punctuation.definition.tag.end.html"
|
|
}
|
|
},
|
|
"end": "(?=/>)|(>)",
|
|
"name": "meta.tag.metadata.style.html",
|
|
"patterns": [
|
|
{
|
|
"include": "#tag-stuff"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"begin": "(?!\\G)",
|
|
"end": "(?=</(?i:style))",
|
|
"name": "source.css",
|
|
"patterns": [
|
|
{
|
|
"include": "#embedded-code"
|
|
},
|
|
{
|
|
"include": "source.css"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"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": "#general-includes"
|
|
}
|
|
]
|
|
},
|
|
"comments": {
|
|
"begin": "@\\*",
|
|
"captures": {
|
|
"0": {
|
|
"name": "punctuation.definition.comment.source.cshtml"
|
|
}
|
|
},
|
|
"end": "\\*@",
|
|
"name": "comment.block.cshtml"
|
|
},
|
|
"line-comments": {
|
|
"name": "comment.line.double-slash.cshtml",
|
|
"begin": "(\\s*)//",
|
|
"end": "$(\\s*)"
|
|
},
|
|
"block-comments": {
|
|
"name": "comment.block.cshtml",
|
|
"begin": "/\\*",
|
|
"end": "((?=})|(\\*/))"
|
|
},
|
|
"single-quotes": {
|
|
"name": "string.quoted.single.cshtml",
|
|
"begin": "'",
|
|
"end": "'"
|
|
},
|
|
"double-quotes": {
|
|
"name": "string.quoted.double.cshtml",
|
|
"begin": "\"",
|
|
"end": "\"",
|
|
"patterns": [
|
|
{
|
|
"include": "text.html.basic"
|
|
}
|
|
]
|
|
},
|
|
"round-brackets": {
|
|
"name": "string.bracers.round.cshtml",
|
|
"begin": "\\(",
|
|
"end": "\\)"
|
|
},
|
|
"squiggly-brackets": {
|
|
"name": "string.bracers.squiggly.cshtml",
|
|
"begin": "{",
|
|
"end": "}"
|
|
},
|
|
"general-includes": {
|
|
"patterns": [
|
|
{
|
|
"include": "#comments"
|
|
},
|
|
{
|
|
"include": "#line-comments"
|
|
},
|
|
{
|
|
"include": "#block-comments"
|
|
},
|
|
{
|
|
"include": "#round-brackets"
|
|
},
|
|
{
|
|
"include": "#squiggly-brackets"
|
|
},
|
|
{
|
|
"include": "#single-quotes"
|
|
},
|
|
{
|
|
"include": "#double-quotes"
|
|
},
|
|
{
|
|
"include": "text.html.basic"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|