Skip to content

Commit 85d6eee

Browse files
author
N. Taylor Mullen
committed
Update Razor's TextMate to latest.
1 parent 0833ccb commit 85d6eee

File tree

1 file changed

+65
-83
lines changed

1 file changed

+65
-83
lines changed

src/razor/syntaxes/aspnetcorerazor.tmLanguage.json

Lines changed: 65 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"name": "keyword.control.razor.directive.codeblock.open"
6363
}
6464
},
65+
"contentName": "source.cs",
6566
"patterns": [
6667
{
6768
"include": "#razor-codeblock-body"
@@ -120,10 +121,10 @@
120121
},
121122
"patterns": [
122123
{
123-
"include": "#balanced-open-close-tag-body"
124+
"include": "#wellformed-html"
124125
},
125126
{
126-
"include": "#wellformed-html"
127+
"include": "$self"
127128
}
128129
],
129130
"end": "(</text>)",
@@ -169,13 +170,13 @@
169170
"include": "#void-tag"
170171
},
171172
{
172-
"include": "#balanced-open-close-tag"
173+
"include": "#non-void-tag"
173174
}
174175
]
175176
},
176177
"void-tag": {
177178
"name": "meta.tag.structure.$3.void.html",
178-
"begin": "(?i)(<)(!?)(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)(?=\\s|/?>)",
179+
"begin": "(?i)(<)(!)?(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)(?=\\s|/?>)",
179180
"beginCaptures": {
180181
"1": {
181182
"name": "punctuation.definition.tag.begin.html"
@@ -199,86 +200,65 @@
199200
}
200201
}
201202
},
202-
"balanced-open-close-tag": {
203-
"begin": "(?=<([^/\\s>]+))",
204-
"patterns": [
205-
{
206-
"include": "#balanced-open-close-tag-start"
207-
},
208-
{
209-
"include": "#balanced-open-close-tag-end"
210-
},
211-
{
212-
"include": "#balanced-open-close-tag-body"
213-
}
214-
],
215-
"end": "(?<=(</\\1>))|(/>)"
216-
},
217-
"balanced-open-close-tag-start": {
218-
"begin": "(<)(?!(/))([^/\\s>]+)",
219-
"beginCaptures": {
203+
"non-void-tag": {
204+
"begin": "(?=<(!)?([^/\\s>]+)(\\s|/?>))",
205+
"end": "(</)(\\2)\\s*(>)|(/>)",
206+
"endCaptures": {
220207
"1": {
221208
"name": "punctuation.definition.tag.begin.html"
222209
},
223210
"2": {
224-
"name": "constant.character.escape.razor.tagHelperOptOut"
211+
"name": "entity.name.tag.html"
225212
},
226213
"3": {
227-
"name": "entity.name.tag.html"
228-
}
229-
},
230-
"patterns": [
231-
{
232-
"include": "#balanced-open-close-tag-attributes"
233-
}
234-
],
235-
"end": "/?>",
236-
"endCaptures": {
237-
"0": {
238214
"name": "punctuation.definition.tag.end.html"
239-
}
240-
}
241-
},
242-
"balanced-open-close-tag-attributes": {
243-
"begin": "(?=\\s)",
244-
"patterns": [
245-
{
246-
"include": "#razor-control-structures"
247215
},
248-
{
249-
"include": "text.html.basic#attribute"
216+
"4": {
217+
"name": "punctuation.definition.tag.end.html"
250218
}
251-
],
252-
"end": "(?=/?>)"
253-
},
254-
"balanced-open-close-tag-body": {
255-
"begin": "(?<=([^/])>)",
219+
},
256220
"patterns": [
257221
{
258-
"include": "#wellformed-html"
222+
"begin": "(<)(!)?([^/\\s>]+)(?=\\s|/?>)",
223+
"beginCaptures": {
224+
"1": {
225+
"name": "punctuation.definition.tag.begin.html"
226+
},
227+
"2": {
228+
"name": "constant.character.escape.razor.tagHelperOptOut"
229+
},
230+
"3": {
231+
"name": "entity.name.tag.html"
232+
}
233+
},
234+
"end": "(?=/?>)",
235+
"patterns": [
236+
{
237+
"include": "#razor-control-structures"
238+
},
239+
{
240+
"include": "text.html.basic#attribute"
241+
}
242+
]
259243
},
260244
{
261-
"include": "$self"
262-
}
263-
],
264-
"end": "(?=\\</)"
265-
},
266-
"balanced-open-close-tag-end": {
267-
"match": "(</)(!?)([^/\\s>]+)\\s*(>)",
268-
"captures": {
269-
"1": {
270-
"name": "punctuation.definition.tag.begin.html"
271-
},
272-
"2": {
273-
"name": "constant.character.escape.razor.tagHelperOptOut"
274-
},
275-
"3": {
276-
"name": "entity.name.tag.html"
277-
},
278-
"4": {
279-
"name": "punctuation.definition.tag.end.html"
245+
"begin": ">",
246+
"beginCaptures": {
247+
"0": {
248+
"name": "punctuation.definition.tag.end.html"
249+
}
250+
},
251+
"end": "(?=</)",
252+
"patterns": [
253+
{
254+
"include": "#wellformed-html"
255+
},
256+
{
257+
"include": "$self"
258+
}
259+
]
280260
}
281-
}
261+
]
282262
},
283263
"explicit-razor-expression": {
284264
"name": "meta.expression.explicit.cshtml",
@@ -309,6 +289,7 @@
309289
},
310290
"implicit-expression": {
311291
"name": "meta.expression.implicit.cshtml",
292+
"contentName": "source.cs",
312293
"begin": "(?<![[:alpha:][:alnum:]])(@)",
313294
"beginCaptures": {
314295
"1": {
@@ -572,6 +553,7 @@
572553
}
573554
},
574555
"name": "meta.structure.razor.directive.codeblock",
556+
"contentName": "source.cs",
575557
"patterns": [
576558
{
577559
"include": "source.cs"
@@ -585,7 +567,7 @@
585567
}
586568
},
587569
"page-directive": {
588-
"name": "meta.directive.page.cshtml",
570+
"name": "meta.directive",
589571
"match": "(@)(page)\\s+([^$]+)?",
590572
"captures": {
591573
"1": {
@@ -608,7 +590,7 @@
608590
}
609591
},
610592
"addTagHelper-directive": {
611-
"name": "meta.directive.addTagHelper.razor",
593+
"name": "meta.directive",
612594
"match": "(@)(addTagHelper)\\s+([^$]+)?",
613595
"captures": {
614596
"1": {
@@ -631,7 +613,7 @@
631613
}
632614
},
633615
"removeTagHelper-directive": {
634-
"name": "meta.directive.removeTagHelper.razor",
616+
"name": "meta.directive",
635617
"match": "(@)(removeTagHelper)\\s+([^$]+)?",
636618
"captures": {
637619
"1": {
@@ -654,7 +636,7 @@
654636
}
655637
},
656638
"tagHelperPrefix-directive": {
657-
"name": "meta.directive.tagHelperPrefix.razor",
639+
"name": "meta.directive",
658640
"match": "(@)(tagHelperPrefix)\\s+([^$]+)?",
659641
"captures": {
660642
"1": {
@@ -691,7 +673,7 @@
691673
"match": "[^$]+"
692674
},
693675
"model-directive": {
694-
"name": "meta.directive.model.cshtml",
676+
"name": "meta.directive",
695677
"match": "(@)(model)\\s+([^$]+)?",
696678
"captures": {
697679
"1": {
@@ -714,7 +696,7 @@
714696
}
715697
},
716698
"inherits-directive": {
717-
"name": "meta.directive.inherits.cshtml",
699+
"name": "meta.directive",
718700
"match": "(@)(inherits)\\s+([^$]+)?",
719701
"captures": {
720702
"1": {
@@ -737,7 +719,7 @@
737719
}
738720
},
739721
"implements-directive": {
740-
"name": "meta.directive.implements.razor",
722+
"name": "meta.directive",
741723
"match": "(@)(implements)\\s+([^$]+)?",
742724
"captures": {
743725
"1": {
@@ -760,7 +742,7 @@
760742
}
761743
},
762744
"layout-directive": {
763-
"name": "meta.directive.layout.razor",
745+
"name": "meta.directive",
764746
"match": "(@)(layout)\\s+([^$]+)?",
765747
"captures": {
766748
"1": {
@@ -783,7 +765,7 @@
783765
}
784766
},
785767
"namespace-directive": {
786-
"name": "meta.directive.namespace.razor",
768+
"name": "meta.directive",
787769
"match": "(@)(namespace)\\s+([^\\s]+)?",
788770
"captures": {
789771
"1": {
@@ -817,7 +799,7 @@
817799
}
818800
},
819801
"inject-directive": {
820-
"name": "meta.directive.inject.cshtml",
802+
"name": "meta.directive",
821803
"match": "(@)(inject)\\s*([\\S\\s]+?)?\\s*([_[:alpha:]][_[:alnum:]]*)?\\s*(?=$)",
822804
"captures": {
823805
"1": {
@@ -843,7 +825,7 @@
843825
}
844826
},
845827
"attribute-directive": {
846-
"name": "meta.directive.attribute.razor",
828+
"name": "meta.directive",
847829
"begin": "(@)(attribute)\\b\\s+",
848830
"beginCaptures": {
849831
"1": {
@@ -865,7 +847,7 @@
865847
"end": "(?<=\\])|$"
866848
},
867849
"section-directive": {
868-
"name": "meta.directive.section.razor",
850+
"name": "meta.directive.block",
869851
"begin": "(@)(section)\\b\\s+([_[:alpha:]][_[:alnum:]]*)?",
870852
"beginCaptures": {
871853
"1": {
@@ -910,7 +892,7 @@
910892
}
911893
},
912894
"using-directive": {
913-
"name": "meta.directive.using.cshtml",
895+
"name": "meta.directive",
914896
"match": "(@)(using)\\b\\s+(?!\\(|\\s)(.+?)?(;)?$",
915897
"captures": {
916898
"1": {

0 commit comments

Comments
 (0)