|
62 | 62 | "name": "keyword.control.razor.directive.codeblock.open"
|
63 | 63 | }
|
64 | 64 | },
|
| 65 | + "contentName": "source.cs", |
65 | 66 | "patterns": [
|
66 | 67 | {
|
67 | 68 | "include": "#razor-codeblock-body"
|
|
120 | 121 | },
|
121 | 122 | "patterns": [
|
122 | 123 | {
|
123 |
| - "include": "#balanced-open-close-tag-body" |
| 124 | + "include": "#wellformed-html" |
124 | 125 | },
|
125 | 126 | {
|
126 |
| - "include": "#wellformed-html" |
| 127 | + "include": "$self" |
127 | 128 | }
|
128 | 129 | ],
|
129 | 130 | "end": "(</text>)",
|
|
169 | 170 | "include": "#void-tag"
|
170 | 171 | },
|
171 | 172 | {
|
172 |
| - "include": "#balanced-open-close-tag" |
| 173 | + "include": "#non-void-tag" |
173 | 174 | }
|
174 | 175 | ]
|
175 | 176 | },
|
176 | 177 | "void-tag": {
|
177 | 178 | "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|/?>)", |
179 | 180 | "beginCaptures": {
|
180 | 181 | "1": {
|
181 | 182 | "name": "punctuation.definition.tag.begin.html"
|
|
199 | 200 | }
|
200 | 201 | }
|
201 | 202 | },
|
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": { |
220 | 207 | "1": {
|
221 | 208 | "name": "punctuation.definition.tag.begin.html"
|
222 | 209 | },
|
223 | 210 | "2": {
|
224 |
| - "name": "constant.character.escape.razor.tagHelperOptOut" |
| 211 | + "name": "entity.name.tag.html" |
225 | 212 | },
|
226 | 213 | "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": { |
238 | 214 | "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" |
247 | 215 | },
|
248 |
| - { |
249 |
| - "include": "text.html.basic#attribute" |
| 216 | + "4": { |
| 217 | + "name": "punctuation.definition.tag.end.html" |
250 | 218 | }
|
251 |
| - ], |
252 |
| - "end": "(?=/?>)" |
253 |
| - }, |
254 |
| - "balanced-open-close-tag-body": { |
255 |
| - "begin": "(?<=([^/])>)", |
| 219 | + }, |
256 | 220 | "patterns": [
|
257 | 221 | {
|
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 | + ] |
259 | 243 | },
|
260 | 244 | {
|
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 | + ] |
280 | 260 | }
|
281 |
| - } |
| 261 | + ] |
282 | 262 | },
|
283 | 263 | "explicit-razor-expression": {
|
284 | 264 | "name": "meta.expression.explicit.cshtml",
|
|
309 | 289 | },
|
310 | 290 | "implicit-expression": {
|
311 | 291 | "name": "meta.expression.implicit.cshtml",
|
| 292 | + "contentName": "source.cs", |
312 | 293 | "begin": "(?<![[:alpha:][:alnum:]])(@)",
|
313 | 294 | "beginCaptures": {
|
314 | 295 | "1": {
|
|
572 | 553 | }
|
573 | 554 | },
|
574 | 555 | "name": "meta.structure.razor.directive.codeblock",
|
| 556 | + "contentName": "source.cs", |
575 | 557 | "patterns": [
|
576 | 558 | {
|
577 | 559 | "include": "source.cs"
|
|
585 | 567 | }
|
586 | 568 | },
|
587 | 569 | "page-directive": {
|
588 |
| - "name": "meta.directive.page.cshtml", |
| 570 | + "name": "meta.directive", |
589 | 571 | "match": "(@)(page)\\s+([^$]+)?",
|
590 | 572 | "captures": {
|
591 | 573 | "1": {
|
|
608 | 590 | }
|
609 | 591 | },
|
610 | 592 | "addTagHelper-directive": {
|
611 |
| - "name": "meta.directive.addTagHelper.razor", |
| 593 | + "name": "meta.directive", |
612 | 594 | "match": "(@)(addTagHelper)\\s+([^$]+)?",
|
613 | 595 | "captures": {
|
614 | 596 | "1": {
|
|
631 | 613 | }
|
632 | 614 | },
|
633 | 615 | "removeTagHelper-directive": {
|
634 |
| - "name": "meta.directive.removeTagHelper.razor", |
| 616 | + "name": "meta.directive", |
635 | 617 | "match": "(@)(removeTagHelper)\\s+([^$]+)?",
|
636 | 618 | "captures": {
|
637 | 619 | "1": {
|
|
654 | 636 | }
|
655 | 637 | },
|
656 | 638 | "tagHelperPrefix-directive": {
|
657 |
| - "name": "meta.directive.tagHelperPrefix.razor", |
| 639 | + "name": "meta.directive", |
658 | 640 | "match": "(@)(tagHelperPrefix)\\s+([^$]+)?",
|
659 | 641 | "captures": {
|
660 | 642 | "1": {
|
|
691 | 673 | "match": "[^$]+"
|
692 | 674 | },
|
693 | 675 | "model-directive": {
|
694 |
| - "name": "meta.directive.model.cshtml", |
| 676 | + "name": "meta.directive", |
695 | 677 | "match": "(@)(model)\\s+([^$]+)?",
|
696 | 678 | "captures": {
|
697 | 679 | "1": {
|
|
714 | 696 | }
|
715 | 697 | },
|
716 | 698 | "inherits-directive": {
|
717 |
| - "name": "meta.directive.inherits.cshtml", |
| 699 | + "name": "meta.directive", |
718 | 700 | "match": "(@)(inherits)\\s+([^$]+)?",
|
719 | 701 | "captures": {
|
720 | 702 | "1": {
|
|
737 | 719 | }
|
738 | 720 | },
|
739 | 721 | "implements-directive": {
|
740 |
| - "name": "meta.directive.implements.razor", |
| 722 | + "name": "meta.directive", |
741 | 723 | "match": "(@)(implements)\\s+([^$]+)?",
|
742 | 724 | "captures": {
|
743 | 725 | "1": {
|
|
760 | 742 | }
|
761 | 743 | },
|
762 | 744 | "layout-directive": {
|
763 |
| - "name": "meta.directive.layout.razor", |
| 745 | + "name": "meta.directive", |
764 | 746 | "match": "(@)(layout)\\s+([^$]+)?",
|
765 | 747 | "captures": {
|
766 | 748 | "1": {
|
|
783 | 765 | }
|
784 | 766 | },
|
785 | 767 | "namespace-directive": {
|
786 |
| - "name": "meta.directive.namespace.razor", |
| 768 | + "name": "meta.directive", |
787 | 769 | "match": "(@)(namespace)\\s+([^\\s]+)?",
|
788 | 770 | "captures": {
|
789 | 771 | "1": {
|
|
817 | 799 | }
|
818 | 800 | },
|
819 | 801 | "inject-directive": {
|
820 |
| - "name": "meta.directive.inject.cshtml", |
| 802 | + "name": "meta.directive", |
821 | 803 | "match": "(@)(inject)\\s*([\\S\\s]+?)?\\s*([_[:alpha:]][_[:alnum:]]*)?\\s*(?=$)",
|
822 | 804 | "captures": {
|
823 | 805 | "1": {
|
|
843 | 825 | }
|
844 | 826 | },
|
845 | 827 | "attribute-directive": {
|
846 |
| - "name": "meta.directive.attribute.razor", |
| 828 | + "name": "meta.directive", |
847 | 829 | "begin": "(@)(attribute)\\b\\s+",
|
848 | 830 | "beginCaptures": {
|
849 | 831 | "1": {
|
|
865 | 847 | "end": "(?<=\\])|$"
|
866 | 848 | },
|
867 | 849 | "section-directive": {
|
868 |
| - "name": "meta.directive.section.razor", |
| 850 | + "name": "meta.directive.block", |
869 | 851 | "begin": "(@)(section)\\b\\s+([_[:alpha:]][_[:alnum:]]*)?",
|
870 | 852 | "beginCaptures": {
|
871 | 853 | "1": {
|
|
910 | 892 | }
|
911 | 893 | },
|
912 | 894 | "using-directive": {
|
913 |
| - "name": "meta.directive.using.cshtml", |
| 895 | + "name": "meta.directive", |
914 | 896 | "match": "(@)(using)\\b\\s+(?!\\(|\\s)(.+?)?(;)?$",
|
915 | 897 | "captures": {
|
916 | 898 | "1": {
|
|
0 commit comments