Skip to content

Commit 7bdc667

Browse files
committed
Change HTML grammar to be more precise (embedded modes). fixes microsoft#14295
1 parent fbabb13 commit 7bdc667

4 files changed

Lines changed: 54 additions & 54 deletions

File tree

extensions/html/syntaxes/html.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
}
153153
},
154154
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
155-
"name": "source.css.embedded.html",
155+
"contentName": "source.css.embedded.html",
156156
"patterns": [
157157
{
158158
"include": "#tag-stuff"
@@ -192,7 +192,7 @@
192192
"name": "punctuation.definition.tag.html"
193193
}
194194
},
195-
"name": "source.js.embedded.html",
195+
"contentName": "source.js.embedded.html",
196196
"patterns": [
197197
{
198198
"include": "#tag-stuff"
@@ -364,7 +364,7 @@
364364
"python": {
365365
"begin": "(?:^\\s*)<\\?python(?!.*\\?>)",
366366
"end": "\\?>(?:\\s*$\\n)?",
367-
"name": "source.python.embedded.html",
367+
"contentName": "source.python.embedded.html",
368368
"patterns": [
369369
{
370370
"include": "source.python"
@@ -389,7 +389,7 @@
389389
"begin": "{{|{",
390390
"disabled": 1,
391391
"end": "}}|}",
392-
"name": "source.smarty.embedded.html",
392+
"contentName": "source.smarty.embedded.html",
393393
"patterns": [
394394
{
395395
"include": "source.smarty"

extensions/html/test/colorize-results/12750_html.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[
22
{
33
"c": "<",
4-
"t": "definition.embedded.html.js.punctuation.source.tag",
4+
"t": "definition.html.punctuation.tag",
55
"r": {
6-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
6+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
77
"light_plus": ".vs .token rgb(0, 0, 0)",
8-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
8+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
99
"light_vs": ".vs .token rgb(0, 0, 0)",
1010
"hc_black": ".hc-black .token rgb(255, 255, 255)"
1111
}
1212
},
1313
{
1414
"c": "script",
15-
"t": "embedded.entity.html.js.name.script.source.tag",
15+
"t": "entity.html.name.script.tag",
1616
"r": {
1717
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
1818
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -232,29 +232,29 @@
232232
},
233233
{
234234
"c": ">",
235-
"t": "definition.embedded.html.js.punctuation.source.tag",
235+
"t": "definition.html.punctuation.tag",
236236
"r": {
237-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
237+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
238238
"light_plus": ".vs .token rgb(0, 0, 0)",
239-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
239+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
240240
"light_vs": ".vs .token rgb(0, 0, 0)",
241241
"hc_black": ".hc-black .token rgb(255, 255, 255)"
242242
}
243243
},
244244
{
245245
"c": "<",
246-
"t": "definition.embedded.html.js.punctuation.source.tag",
246+
"t": "definition.html.punctuation.tag",
247247
"r": {
248-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
248+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
249249
"light_plus": ".vs .token rgb(0, 0, 0)",
250-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
250+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
251251
"light_vs": ".vs .token rgb(0, 0, 0)",
252252
"hc_black": ".hc-black .token rgb(255, 255, 255)"
253253
}
254254
},
255255
{
256256
"c": "script",
257-
"t": "embedded.entity.html.js.name.script.source.tag",
257+
"t": "entity.html.name.script.tag",
258258
"r": {
259259
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
260260
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -408,11 +408,11 @@
408408
},
409409
{
410410
"c": ">",
411-
"t": "definition.embedded.html.js.punctuation.source.tag",
411+
"t": "definition.html.punctuation.tag",
412412
"r": {
413-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
413+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
414414
"light_plus": ".vs .token rgb(0, 0, 0)",
415-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
415+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
416416
"light_vs": ".vs .token rgb(0, 0, 0)",
417417
"hc_black": ".hc-black .token rgb(255, 255, 255)"
418418
}

extensions/html/test/colorize-results/test_html.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@
441441
},
442442
{
443443
"c": "\t",
444-
"t": "css.embedded.html.source",
444+
"t": "",
445445
"r": {
446446
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
447447
"light_plus": ".vs .token rgb(0, 0, 0)",
@@ -452,7 +452,7 @@
452452
},
453453
{
454454
"c": "<",
455-
"t": "css.definition.embedded.html.punctuation.source.tag",
455+
"t": "definition.html.punctuation.tag",
456456
"r": {
457457
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
458458
"light_plus": ".vs .token rgb(0, 0, 0)",
@@ -463,7 +463,7 @@
463463
},
464464
{
465465
"c": "style",
466-
"t": "css.embedded.entity.html.name.source.style.tag",
466+
"t": "entity.html.name.style.tag",
467467
"r": {
468468
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
469469
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -771,7 +771,7 @@
771771
},
772772
{
773773
"c": "</",
774-
"t": "css.definition.embedded.html.punctuation.source.tag",
774+
"t": "definition.html.punctuation.tag",
775775
"r": {
776776
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
777777
"light_plus": ".vs .token rgb(0, 0, 0)",
@@ -782,7 +782,7 @@
782782
},
783783
{
784784
"c": "style",
785-
"t": "css.embedded.entity.html.name.source.style.tag",
785+
"t": "entity.html.name.style.tag",
786786
"r": {
787787
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
788788
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -793,7 +793,7 @@
793793
},
794794
{
795795
"c": ">",
796-
"t": "css.definition.embedded.html.punctuation.source.tag",
796+
"t": "definition.html.punctuation.tag",
797797
"r": {
798798
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
799799
"light_plus": ".vs .token rgb(0, 0, 0)",
@@ -1079,7 +1079,7 @@
10791079
},
10801080
{
10811081
"c": "\t",
1082-
"t": "embedded.html.js.source",
1082+
"t": "",
10831083
"r": {
10841084
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
10851085
"light_plus": ".vs .token rgb(0, 0, 0)",
@@ -1090,18 +1090,18 @@
10901090
},
10911091
{
10921092
"c": "<",
1093-
"t": "definition.embedded.html.js.punctuation.source.tag",
1093+
"t": "definition.html.punctuation.tag",
10941094
"r": {
1095-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
1095+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
10961096
"light_plus": ".vs .token rgb(0, 0, 0)",
1097-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
1097+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
10981098
"light_vs": ".vs .token rgb(0, 0, 0)",
10991099
"hc_black": ".hc-black .token rgb(255, 255, 255)"
11001100
}
11011101
},
11021102
{
11031103
"c": "script",
1104-
"t": "embedded.entity.html.js.name.script.source.tag",
1104+
"t": "entity.html.name.script.tag",
11051105
"r": {
11061106
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
11071107
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -1200,18 +1200,18 @@
12001200
},
12011201
{
12021202
"c": ">",
1203-
"t": "definition.embedded.html.js.punctuation.source.tag",
1203+
"t": "definition.html.punctuation.tag",
12041204
"r": {
1205-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
1205+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
12061206
"light_plus": ".vs .token rgb(0, 0, 0)",
1207-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
1207+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
12081208
"light_vs": ".vs .token rgb(0, 0, 0)",
12091209
"hc_black": ".hc-black .token rgb(255, 255, 255)"
12101210
}
12111211
},
12121212
{
12131213
"c": "\t",
1214-
"t": "embedded.html.js.source",
1214+
"t": "",
12151215
"r": {
12161216
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
12171217
"light_plus": ".vs .token rgb(0, 0, 0)",
@@ -1222,18 +1222,18 @@
12221222
},
12231223
{
12241224
"c": "<",
1225-
"t": "definition.embedded.html.js.punctuation.source.tag",
1225+
"t": "definition.html.punctuation.tag",
12261226
"r": {
1227-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
1227+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
12281228
"light_plus": ".vs .token rgb(0, 0, 0)",
1229-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
1229+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
12301230
"light_vs": ".vs .token rgb(0, 0, 0)",
12311231
"hc_black": ".hc-black .token rgb(255, 255, 255)"
12321232
}
12331233
},
12341234
{
12351235
"c": "script",
1236-
"t": "embedded.entity.html.js.name.script.source.tag",
1236+
"t": "entity.html.name.script.tag",
12371237
"r": {
12381238
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
12391239
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -1332,18 +1332,18 @@
13321332
},
13331333
{
13341334
"c": ">",
1335-
"t": "definition.embedded.html.js.punctuation.source.tag",
1335+
"t": "definition.html.punctuation.tag",
13361336
"r": {
1337-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
1337+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
13381338
"light_plus": ".vs .token rgb(0, 0, 0)",
1339-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
1339+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
13401340
"light_vs": ".vs .token rgb(0, 0, 0)",
13411341
"hc_black": ".hc-black .token rgb(255, 255, 255)"
13421342
}
13431343
},
13441344
{
13451345
"c": "\t",
1346-
"t": "embedded.html.js.source",
1346+
"t": "",
13471347
"r": {
13481348
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
13491349
"light_plus": ".vs .token rgb(0, 0, 0)",
@@ -1354,18 +1354,18 @@
13541354
},
13551355
{
13561356
"c": "<",
1357-
"t": "definition.embedded.html.js.punctuation.source.tag",
1357+
"t": "definition.html.punctuation.tag",
13581358
"r": {
1359-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
1359+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
13601360
"light_plus": ".vs .token rgb(0, 0, 0)",
1361-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
1361+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
13621362
"light_vs": ".vs .token rgb(0, 0, 0)",
13631363
"hc_black": ".hc-black .token rgb(255, 255, 255)"
13641364
}
13651365
},
13661366
{
13671367
"c": "script",
1368-
"t": "embedded.entity.html.js.name.script.source.tag",
1368+
"t": "entity.html.name.script.tag",
13691369
"r": {
13701370
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
13711371
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -2179,11 +2179,11 @@
21792179
},
21802180
{
21812181
"c": ">",
2182-
"t": "definition.embedded.html.js.punctuation.source.tag",
2182+
"t": "definition.html.punctuation.tag",
21832183
"r": {
2184-
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.tag.js rgb(128, 128, 128)",
2184+
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
21852185
"light_plus": ".vs .token rgb(0, 0, 0)",
2186-
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.tag.js rgb(128, 128, 128)",
2186+
"dark_vs": ".vs-dark .token rgb(212, 212, 212)",
21872187
"light_vs": ".vs .token rgb(0, 0, 0)",
21882188
"hc_black": ".hc-black .token rgb(255, 255, 255)"
21892189
}

extensions/markdown/test/colorize-results/test_md.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@
10241024
},
10251025
{
10261026
"c": " ",
1027-
"t": "css.embedded.html.markdown.meta.paragraph.source",
1027+
"t": "markdown.meta.paragraph",
10281028
"r": {
10291029
"dark_plus": ".vs-dark .token rgb(212, 212, 212)",
10301030
"light_plus": ".vs .token rgb(0, 0, 0)",
@@ -1035,7 +1035,7 @@
10351035
},
10361036
{
10371037
"c": "<",
1038-
"t": "css.definition.embedded.html.markdown.meta.paragraph.punctuation.source.tag",
1038+
"t": "definition.html.markdown.meta.paragraph.punctuation.tag",
10391039
"r": {
10401040
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)",
10411041
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)",
@@ -1046,7 +1046,7 @@
10461046
},
10471047
{
10481048
"c": "style",
1049-
"t": "css.embedded.entity.html.markdown.meta.name.paragraph.source.style.tag",
1049+
"t": "entity.html.markdown.meta.name.paragraph.style.tag",
10501050
"r": {
10511051
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
10521052
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -1222,7 +1222,7 @@
12221222
},
12231223
{
12241224
"c": "</",
1225-
"t": "css.definition.embedded.html.markdown.meta.paragraph.punctuation.source.tag",
1225+
"t": "definition.html.markdown.meta.paragraph.punctuation.tag",
12261226
"r": {
12271227
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)",
12281228
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)",
@@ -1233,7 +1233,7 @@
12331233
},
12341234
{
12351235
"c": "style",
1236-
"t": "css.embedded.entity.html.markdown.meta.name.paragraph.source.style.tag",
1236+
"t": "entity.html.markdown.meta.name.paragraph.style.tag",
12371237
"r": {
12381238
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.tag rgb(86, 156, 214)",
12391239
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.tag rgb(128, 0, 0)",
@@ -1244,7 +1244,7 @@
12441244
},
12451245
{
12461246
"c": ">",
1247-
"t": "css.definition.embedded.html.markdown.meta.paragraph.punctuation.source.tag",
1247+
"t": "definition.html.markdown.meta.paragraph.punctuation.tag",
12481248
"r": {
12491249
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.tag rgb(128, 128, 128)",
12501250
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.tag rgb(128, 0, 0)",

0 commit comments

Comments
 (0)