Skip to content

Commit ae5c283

Browse files
authored
Pick up updated js/ts grammar (microsoft#26094)
1 parent e2721f4 commit ae5c283

3 files changed

Lines changed: 45 additions & 15 deletions

File tree

extensions/javascript/syntaxes/JavaScript.tmLanguage.json

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4008,8 +4008,8 @@
40084008
},
40094009
"jsx-tag-without-attributes": {
40104010
"name": "meta.tag.without-attributes.js",
4011-
"begin": "(<)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)",
4012-
"end": "(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)",
4011+
"begin": "(<)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\\s*(>)",
4012+
"end": "(</)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\\s*(>)",
40134013
"beginCaptures": {
40144014
"1": {
40154015
"name": "punctuation.definition.tag.begin.js"
@@ -4018,6 +4018,9 @@
40184018
"name": "entity.name.tag.js"
40194019
},
40204020
"3": {
4021+
"name": "support.class.component.js"
4022+
},
4023+
"4": {
40214024
"name": "punctuation.definition.tag.end.js"
40224025
}
40234026
},
@@ -4029,6 +4032,9 @@
40294032
"name": "entity.name.tag.js"
40304033
},
40314034
"3": {
4035+
"name": "support.class.component.js"
4036+
},
4037+
"4": {
40324038
"name": "punctuation.definition.tag.end.js"
40334039
}
40344040
},
@@ -4041,7 +4047,7 @@
40414047
},
40424048
"jsx-tag-in-expression": {
40434049
"begin": "(?x)\n (?<=[({\\[,?=>:*]|&&|\\|\\||\\?|\\Wreturn|^return|\\Wdefault|^)\\s*\n (?!(<)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)) #look ahead is not start of tag without attributes\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))",
4044-
"end": "(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>))",
4050+
"end": "(/>)|(?:(</)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\\s*(>))",
40454051
"endCaptures": {
40464052
"0": {
40474053
"name": "meta.tag.js"
@@ -4056,6 +4062,9 @@
40564062
"name": "entity.name.tag.js"
40574063
},
40584064
"4": {
4065+
"name": "support.class.component.js"
4066+
},
4067+
"5": {
40594068
"name": "punctuation.definition.tag.end.js"
40604069
}
40614070
},
@@ -4067,7 +4076,7 @@
40674076
},
40684077
"jsx-child-tag": {
40694078
"begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))",
4070-
"end": "(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>))",
4079+
"end": "(/>)|(?:(</)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\\s*(>))",
40714080
"endCaptures": {
40724081
"0": {
40734082
"name": "meta.tag.js"
@@ -4082,6 +4091,9 @@
40824091
"name": "entity.name.tag.js"
40834092
},
40844093
"4": {
4094+
"name": "support.class.component.js"
4095+
},
4096+
"5": {
40854097
"name": "punctuation.definition.tag.end.js"
40864098
}
40874099
},
@@ -4097,13 +4109,16 @@
40974109
"end": "(?=(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)))",
40984110
"patterns": [
40994111
{
4100-
"begin": "(?x)\n (<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>)",
4112+
"begin": "(?x)\n (<)\\s*\n ((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>)",
41014113
"beginCaptures": {
41024114
"1": {
41034115
"name": "punctuation.definition.tag.begin.js"
41044116
},
41054117
"2": {
41064118
"name": "entity.name.tag.js"
4119+
},
4120+
"3": {
4121+
"name": "support.class.component.js"
41074122
}
41084123
},
41094124
"end": "(?=[/]?>)",
@@ -4173,5 +4188,5 @@
41734188
]
41744189
}
41754190
},
4176-
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/9f6676aa2ddb75cb5a9dbe1f59024069e839d986"
4191+
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/cb1af7953db224204607cbe22d3a45aa0f77a4c1"
41774192
}

extensions/javascript/test/colorize-results/test_jsx.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,10 +2157,10 @@
21572157
},
21582158
{
21592159
"c": "ToggleText",
2160-
"t": "source.js meta.tag.js entity.name.tag.js",
2160+
"t": "source.js meta.tag.js entity.name.tag.js support.class.component.js",
21612161
"r": {
2162-
"dark_plus": "entity.name.tag: #569CD6",
2163-
"light_plus": "entity.name.tag: #800000",
2162+
"dark_plus": "support.class: #4EC9B0",
2163+
"light_plus": "support.class: #267F99",
21642164
"dark_vs": "entity.name.tag: #569CD6",
21652165
"light_vs": "entity.name.tag: #800000",
21662166
"hc_black": "entity.name.tag: #569CD6"

extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4005,8 +4005,8 @@
40054005
},
40064006
"jsx-tag-without-attributes": {
40074007
"name": "meta.tag.without-attributes.tsx",
4008-
"begin": "(<)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)",
4009-
"end": "(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)",
4008+
"begin": "(<)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\\s*(>)",
4009+
"end": "(</)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\\s*(>)",
40104010
"beginCaptures": {
40114011
"1": {
40124012
"name": "punctuation.definition.tag.begin.tsx"
@@ -4015,6 +4015,9 @@
40154015
"name": "entity.name.tag.tsx"
40164016
},
40174017
"3": {
4018+
"name": "support.class.component.tsx"
4019+
},
4020+
"4": {
40184021
"name": "punctuation.definition.tag.end.tsx"
40194022
}
40204023
},
@@ -4026,6 +4029,9 @@
40264029
"name": "entity.name.tag.tsx"
40274030
},
40284031
"3": {
4032+
"name": "support.class.component.tsx"
4033+
},
4034+
"4": {
40294035
"name": "punctuation.definition.tag.end.tsx"
40304036
}
40314037
},
@@ -4038,7 +4044,7 @@
40384044
},
40394045
"jsx-tag-in-expression": {
40404046
"begin": "(?x)\n (?<=[({\\[,?=>:*]|&&|\\|\\||\\?|\\Wreturn|^return|\\Wdefault|^)\\s*\n (?!(<)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)) #look ahead is not start of tag without attributes\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))",
4041-
"end": "(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>))",
4047+
"end": "(/>)|(?:(</)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\\s*(>))",
40424048
"endCaptures": {
40434049
"0": {
40444050
"name": "meta.tag.tsx"
@@ -4053,6 +4059,9 @@
40534059
"name": "entity.name.tag.tsx"
40544060
},
40554061
"4": {
4062+
"name": "support.class.component.tsx"
4063+
},
4064+
"5": {
40564065
"name": "punctuation.definition.tag.end.tsx"
40574066
}
40584067
},
@@ -4064,7 +4073,7 @@
40644073
},
40654074
"jsx-child-tag": {
40664075
"begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))",
4067-
"end": "(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>))",
4076+
"end": "(/>)|(?:(</)\\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\\s*(>))",
40684077
"endCaptures": {
40694078
"0": {
40704079
"name": "meta.tag.tsx"
@@ -4079,6 +4088,9 @@
40794088
"name": "entity.name.tag.tsx"
40804089
},
40814090
"4": {
4091+
"name": "support.class.component.tsx"
4092+
},
4093+
"5": {
40824094
"name": "punctuation.definition.tag.end.tsx"
40834095
}
40844096
},
@@ -4094,13 +4106,16 @@
40944106
"end": "(?=(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)))",
40954107
"patterns": [
40964108
{
4097-
"begin": "(?x)\n (<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>)",
4109+
"begin": "(?x)\n (<)\\s*\n ((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\\w.]*))(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>)",
40984110
"beginCaptures": {
40994111
"1": {
41004112
"name": "punctuation.definition.tag.begin.tsx"
41014113
},
41024114
"2": {
41034115
"name": "entity.name.tag.tsx"
4116+
},
4117+
"3": {
4118+
"name": "support.class.component.tsx"
41044119
}
41054120
},
41064121
"end": "(?=[/]?>)",
@@ -4170,5 +4185,5 @@
41704185
]
41714186
}
41724187
},
4173-
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/9f6676aa2ddb75cb5a9dbe1f59024069e839d986"
4188+
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/cb1af7953db224204607cbe22d3a45aa0f77a4c1"
41744189
}

0 commit comments

Comments
 (0)