diff --git a/src/razor/syntaxes/aspnetcorerazor.tmLanguage.json b/src/razor/syntaxes/aspnetcorerazor.tmLanguage.json index 02ce064c1..8459bdac2 100644 --- a/src/razor/syntaxes/aspnetcorerazor.tmLanguage.json +++ b/src/razor/syntaxes/aspnetcorerazor.tmLanguage.json @@ -62,6 +62,7 @@ "name": "keyword.control.razor.directive.codeblock.open" } }, + "contentName": "source.cs", "patterns": [ { "include": "#razor-codeblock-body" @@ -120,10 +121,10 @@ }, "patterns": [ { - "include": "#balanced-open-close-tag-body" + "include": "#wellformed-html" }, { - "include": "#wellformed-html" + "include": "$self" } ], "end": "()", @@ -169,13 +170,13 @@ "include": "#void-tag" }, { - "include": "#balanced-open-close-tag" + "include": "#non-void-tag" } ] }, "void-tag": { "name": "meta.tag.structure.$3.void.html", - "begin": "(?i)(<)(!?)(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)(?=\\s|/?>)", + "begin": "(?i)(<)(!)?(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" @@ -199,86 +200,65 @@ } } }, - "balanced-open-close-tag": { - "begin": "(?=<([^/\\s>]+))", - "patterns": [ - { - "include": "#balanced-open-close-tag-start" - }, - { - "include": "#balanced-open-close-tag-end" - }, - { - "include": "#balanced-open-close-tag-body" - } - ], - "end": "(?<=())|(/>)" - }, - "balanced-open-close-tag-start": { - "begin": "(<)(?!(/))([^/\\s>]+)", - "beginCaptures": { + "non-void-tag": { + "begin": "(?=<(!)?([^/\\s>]+)(\\s|/?>))", + "end": "()|(/>)", + "endCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { - "name": "constant.character.escape.razor.tagHelperOptOut" + "name": "entity.name.tag.html" }, "3": { - "name": "entity.name.tag.html" - } - }, - "patterns": [ - { - "include": "#balanced-open-close-tag-attributes" - } - ], - "end": "/?>", - "endCaptures": { - "0": { "name": "punctuation.definition.tag.end.html" - } - } - }, - "balanced-open-close-tag-attributes": { - "begin": "(?=\\s)", - "patterns": [ - { - "include": "#razor-control-structures" }, - { - "include": "text.html.basic#attribute" + "4": { + "name": "punctuation.definition.tag.end.html" } - ], - "end": "(?=/?>)" - }, - "balanced-open-close-tag-body": { - "begin": "(?<=([^/])>)", + }, "patterns": [ { - "include": "#wellformed-html" + "begin": "(<)(!)?([^/\\s>]+)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "constant.character.escape.razor.tagHelperOptOut" + }, + "3": { + "name": "entity.name.tag.html" + } + }, + "end": "(?=/?>)", + "patterns": [ + { + "include": "#razor-control-structures" + }, + { + "include": "text.html.basic#attribute" + } + ] }, { - "include": "$self" - } - ], - "end": "(?=\\]+)\\s*(>)", - "captures": { - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "constant.character.escape.razor.tagHelperOptOut" - }, - "3": { - "name": "entity.name.tag.html" - }, - "4": { - "name": "punctuation.definition.tag.end.html" + "begin": ">", + "beginCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?=