提交 fdf8a61d 编写于 作者: M Martin Aeschlimann

[razor] update grammar (fixes #30084)

上级 ad61de65
......@@ -6,7 +6,7 @@
"vscode": "0.10.x"
},
"scripts": {
"update-grammar": "node ../../build/npm/update-grammar.js demyte/language-cshtml grammars/cshtml.cson ./syntaxes/cshtml.json"
"update-grammar": "node ../../build/npm/update-grammar.js demyte/language-cshtml grammars/cshtml.json ./syntaxes/cshtml.json"
},
"contributes": {
"languages": [{
......
{
"information_for_contributors": [
"This file has been converted from https://github.com/demyte/language-cshtml/blob/master/grammars/cshtml.cson",
"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",
"fileTypes": [
......@@ -35,21 +36,14 @@
}
},
"patterns": [
{
"name": "string.quoted.single.cshtml",
"match": "'"
},
{
"include": "#embedded-code"
},
{
"include": "#comments"
"include": "#general-includes"
},
{
"include": "source.cs"
},
{
"include": "text.html.basic"
}
],
"end": "\\}",
......@@ -59,18 +53,14 @@
}
}
},
{
"name": "string.quoted.single.cshtml",
"match": "'"
},
{
"include": "#embedded-code"
},
{
"include": "#comments"
"include": "#general-includes"
},
{
"include": "text.html.basic"
"include": "source.cs"
}
],
"end": "\\}",
......@@ -107,17 +97,32 @@
"include": "#embedded-code"
},
{
"include": "#comments"
"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": "source.cs"
"include": "#general-includes"
},
{
"include": "text.html.basic"
"include": "source.cs"
}
],
"end": "(\\n|\\s)",
"comments": "Covers single line Razor tags"
"end": "(\\))",
"comments": "Covers same line Razor statments with embedded C#"
},
{
"include": "#comments"
......@@ -139,7 +144,7 @@
},
"patterns": [
{
"include": "#comments"
"include": "#general-includes"
}
]
},
......@@ -152,6 +157,69 @@
},
"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"
}
]
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册