Skip to content

Commit d470f32

Browse files
committed
Merge branch 'master' into add-braces
2 parents 5497b42 + dd6dc5e commit d470f32

62 files changed

Lines changed: 966 additions & 166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/compiler/checker.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24752,7 +24752,11 @@ namespace ts {
2475224752
case SyntaxKind.ParenthesizedExpression:
2475324753
return evaluate((<ParenthesizedExpression>expr).expression);
2475424754
case SyntaxKind.Identifier:
24755-
return nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), (<Identifier>expr).escapedText);
24755+
const identifier = <Identifier>expr;
24756+
if (isInfinityOrNaNString(identifier.escapedText)) {
24757+
return +(identifier.escapedText);
24758+
}
24759+
return nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
2475624760
case SyntaxKind.ElementAccessExpression:
2475724761
case SyntaxKind.PropertyAccessExpression:
2475824762
const ex = <PropertyAccessExpression | ElementAccessExpression>expr;
@@ -27061,7 +27065,7 @@ namespace ts {
2706127065
}
2706227066
}
2706327067

27064-
// We do global augmentations seperately from module augmentations (and before creating global types) because they
27068+
// We do global augmentations separately from module augmentations (and before creating global types) because they
2706527069
// 1. Affect global types. We won't have the correct global types until global augmentations are merged. Also,
2706627070
// 2. Module augmentation instantiation requires creating the type of a module, which, in turn, can require
2706727071
// checking for an export or property on the module (if export=) which, in turn, can fall back to the

src/compiler/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,7 @@ namespace ts {
26532653
/**
26542654
* Matches any single directory segment unless it is the last segment and a .min.js file
26552655
* Breakdown:
2656-
* [^./] # matches everything up to the first . character (excluding directory seperators)
2656+
* [^./] # matches everything up to the first . character (excluding directory separators)
26572657
* (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension
26582658
*/
26592659
singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*",

src/compiler/diagnosticMessages.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4281,16 +4281,20 @@
42814281
"category": "Message",
42824282
"code": 95054
42834283
},
4284-
"Add or remove braces in an arrow function": {
4284+
"Convert '{0}' to mapped object type": {
42854285
"category": "Message",
42864286
"code": 95055
42874287
},
4288-
"Add braces to arrow function": {
4288+
"Add or remove braces in an arrow function": {
42894289
"category": "Message",
42904290
"code": 95056
42914291
},
4292-
"Remove braces from arrow function": {
4292+
"Add braces to arrow function": {
42934293
"category": "Message",
42944294
"code": 95057
4295+
},
4296+
"Remove braces from arrow function": {
4297+
"category": "Message",
4298+
"code": 95058
42954299
}
42964300
}

src/compiler/scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ namespace ts {
13081308
let isPreviousTokenSeparator = false;
13091309
while (true) {
13101310
const ch = text.charCodeAt(pos);
1311-
// Numeric seperators are allowed anywhere within a numeric literal, except not at the beginning, or following another separator
1311+
// Numeric separators are allowed anywhere within a numeric literal, except not at the beginning, or following another separator
13121312
if (ch === CharacterCodes._) {
13131313
tokenFlags |= TokenFlags.ContainsSeparator;
13141314
if (separatorAllowed) {

src/harness/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"../services/documentRegistry.ts",
6464
"../services/importTracker.ts",
6565
"../services/findAllReferences.ts",
66+
"../services/getEditsForFileRename.ts",
6667
"../services/goToDefinition.ts",
6768
"../services/jsDoc.ts",
6869
"../services/semver.ts",
@@ -118,6 +119,7 @@
118119
"../services/codefixes/requireInTs.ts",
119120
"../services/codefixes/useDefaultImport.ts",
120121
"../services/codefixes/fixAddModuleReferTypeMissingTypeof.ts",
122+
"../services/codefixes/convertToMappedObjectType.ts",
121123
"../services/refactors/extractSymbol.ts",
122124
"../services/refactors/generateGetAccessorAndSetAccessor.ts",
123125
"../services/refactors/moveToNewFile.ts",

src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,15 @@
10081008
</Str>
10091009
<Disp Icon="Str" />
10101010
</Item>
1011+
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
1012+
<Str Cat="Text">
1013+
<Val><![CDATA[Add missing 'typeof']]></Val>
1014+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1015+
<Val><![CDATA[新增遺漏的 'typeof']]></Val>
1016+
</Tgt>
1017+
</Str>
1018+
<Disp Icon="Str" />
1019+
</Item>
10111020
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
10121021
<Str Cat="Text">
10131022
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
@@ -1125,6 +1134,15 @@
11251134
</Str>
11261135
<Disp Icon="Str" />
11271136
</Item>
1137+
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
1138+
<Str Cat="Text">
1139+
<Val><![CDATA[All variables are unused.]]></Val>
1140+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1141+
<Val><![CDATA[所有變數都未使用。]]></Val>
1142+
</Tgt>
1143+
</Str>
1144+
<Disp Icon="Str" />
1145+
</Item>
11281146
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
11291147
<Str Cat="Text">
11301148
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
@@ -6564,6 +6582,15 @@
65646582
</Str>
65656583
<Disp Icon="Str" />
65666584
</Item>
6585+
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
6586+
<Str Cat="Text">
6587+
<Val><![CDATA[Remove all unused labels]]></Val>
6588+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6589+
<Val><![CDATA[移除所有未使用的標籤]]></Val>
6590+
</Tgt>
6591+
</Str>
6592+
<Disp Icon="Str" />
6593+
</Item>
65676594
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
65686595
<Str Cat="Text">
65696596
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
@@ -6603,6 +6630,24 @@
66036630
</Str>
66046631
<Disp Icon="Str" />
66056632
</Item>
6633+
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
6634+
<Str Cat="Text">
6635+
<Val><![CDATA[Remove unused label]]></Val>
6636+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6637+
<Val><![CDATA[移除未使用的標籤]]></Val>
6638+
</Tgt>
6639+
</Str>
6640+
<Disp Icon="Str" />
6641+
</Item>
6642+
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
6643+
<Str Cat="Text">
6644+
<Val><![CDATA[Remove variable statement]]></Val>
6645+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6646+
<Val><![CDATA[移除變數陳述式]]></Val>
6647+
</Tgt>
6648+
</Str>
6649+
<Disp Icon="Str" />
6650+
</Item>
66066651
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
66076652
<Str Cat="Text">
66086653
<Val><![CDATA[Replace import with '{0}'.]]></Val>

src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,10 +1019,13 @@
10191019
</Item>
10201020
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
10211021
<Str Cat="Text">
1022-
<Val><![CDATA[Add missing typeof]]></Val>
1022+
<Val><![CDATA[Add missing 'typeof']]></Val>
10231023
<Tgt Cat="Text" Stat="Loc" Orig="New">
1024-
<Val><![CDATA[Ajouter un typeof manquant]]></Val>
1024+
<Val><![CDATA[Ajouter un 'typeof' manquant]]></Val>
10251025
</Tgt>
1026+
<Prev Cat="Text">
1027+
<Val><![CDATA[Add missing typeof]]></Val>
1028+
</Prev>
10261029
</Str>
10271030
<Disp Icon="Str" />
10281031
</Item>
@@ -1143,6 +1146,15 @@
11431146
</Str>
11441147
<Disp Icon="Str" />
11451148
</Item>
1149+
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
1150+
<Str Cat="Text">
1151+
<Val><![CDATA[All variables are unused.]]></Val>
1152+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1153+
<Val><![CDATA[Toutes les variables sont inutilisées.]]></Val>
1154+
</Tgt>
1155+
</Str>
1156+
<Disp Icon="Str" />
1157+
</Item>
11461158
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
11471159
<Str Cat="Text">
11481160
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
@@ -6582,6 +6594,15 @@
65826594
</Str>
65836595
<Disp Icon="Str" />
65846596
</Item>
6597+
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
6598+
<Str Cat="Text">
6599+
<Val><![CDATA[Remove all unused labels]]></Val>
6600+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6601+
<Val><![CDATA[Supprimer toutes les étiquettes inutilisées]]></Val>
6602+
</Tgt>
6603+
</Str>
6604+
<Disp Icon="Str" />
6605+
</Item>
65856606
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
65866607
<Str Cat="Text">
65876608
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
@@ -6621,6 +6642,24 @@
66216642
</Str>
66226643
<Disp Icon="Str" />
66236644
</Item>
6645+
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
6646+
<Str Cat="Text">
6647+
<Val><![CDATA[Remove unused label]]></Val>
6648+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6649+
<Val><![CDATA[Supprimer l'étiquette inutilisée]]></Val>
6650+
</Tgt>
6651+
</Str>
6652+
<Disp Icon="Str" />
6653+
</Item>
6654+
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
6655+
<Str Cat="Text">
6656+
<Val><![CDATA[Remove variable statement]]></Val>
6657+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6658+
<Val><![CDATA[Supprimer l'instruction de variable]]></Val>
6659+
</Tgt>
6660+
</Str>
6661+
<Disp Icon="Str" />
6662+
</Item>
66246663
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
66256664
<Str Cat="Text">
66266665
<Val><![CDATA[Replace import with '{0}'.]]></Val>

src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,15 @@
10071007
</Str>
10081008
<Disp Icon="Str" />
10091009
</Item>
1010+
<Item ItemId=";Add_missing_typeof_95052" ItemType="0" PsrId="306" Leaf="true">
1011+
<Str Cat="Text">
1012+
<Val><![CDATA[Add missing 'typeof']]></Val>
1013+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1014+
<Val><![CDATA[Добавить отсутствующий "typeof"]]></Val>
1015+
</Tgt>
1016+
</Str>
1017+
<Disp Icon="Str" />
1018+
</Item>
10101019
<Item ItemId=";Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
10111020
<Str Cat="Text">
10121021
<Val><![CDATA[Add qualifier to all unresolved variables matching a member name]]></Val>
@@ -1124,6 +1133,15 @@
11241133
</Str>
11251134
<Disp Icon="Str" />
11261135
</Item>
1136+
<Item ItemId=";All_variables_are_unused_6199" ItemType="0" PsrId="306" Leaf="true">
1137+
<Str Cat="Text">
1138+
<Val><![CDATA[All variables are unused.]]></Val>
1139+
<Tgt Cat="Text" Stat="Loc" Orig="New">
1140+
<Val><![CDATA[Ни одна переменная не используется.]]></Val>
1141+
</Tgt>
1142+
</Str>
1143+
<Disp Icon="Str" />
1144+
</Item>
11271145
<Item ItemId=";Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011" ItemType="0" PsrId="306" Leaf="true">
11281146
<Str Cat="Text">
11291147
<Val><![CDATA[Allow default imports from modules with no default export. This does not affect code emit, just typechecking.]]></Val>
@@ -6563,6 +6581,15 @@
65636581
</Str>
65646582
<Disp Icon="Str" />
65656583
</Item>
6584+
<Item ItemId=";Remove_all_unused_labels_95054" ItemType="0" PsrId="306" Leaf="true">
6585+
<Str Cat="Text">
6586+
<Val><![CDATA[Remove all unused labels]]></Val>
6587+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6588+
<Val><![CDATA[Удалить все неиспользуемые метки]]></Val>
6589+
</Tgt>
6590+
</Str>
6591+
<Disp Icon="Str" />
6592+
</Item>
65666593
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
65676594
<Str Cat="Text">
65686595
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
@@ -6602,6 +6629,24 @@
66026629
</Str>
66036630
<Disp Icon="Str" />
66046631
</Item>
6632+
<Item ItemId=";Remove_unused_label_95053" ItemType="0" PsrId="306" Leaf="true">
6633+
<Str Cat="Text">
6634+
<Val><![CDATA[Remove unused label]]></Val>
6635+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6636+
<Val><![CDATA[Удалить неиспользуемую метку]]></Val>
6637+
</Tgt>
6638+
</Str>
6639+
<Disp Icon="Str" />
6640+
</Item>
6641+
<Item ItemId=";Remove_variable_statement_90010" ItemType="0" PsrId="306" Leaf="true">
6642+
<Str Cat="Text">
6643+
<Val><![CDATA[Remove variable statement]]></Val>
6644+
<Tgt Cat="Text" Stat="Loc" Orig="New">
6645+
<Val><![CDATA[Удалить оператор с переменной]]></Val>
6646+
</Tgt>
6647+
</Str>
6648+
<Disp Icon="Str" />
6649+
</Item>
66056650
<Item ItemId=";Replace_import_with_0_95015" ItemType="0" PsrId="306" Leaf="true">
66066651
<Str Cat="Text">
66076652
<Val><![CDATA[Replace import with '{0}'.]]></Val>

src/server/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"../services/documentRegistry.ts",
6060
"../services/importTracker.ts",
6161
"../services/findAllReferences.ts",
62+
"../services/getEditsForFileRename.ts",
6263
"../services/goToDefinition.ts",
6364
"../services/jsDoc.ts",
6465
"../services/semver.ts",
@@ -114,6 +115,7 @@
114115
"../services/codefixes/requireInTs.ts",
115116
"../services/codefixes/useDefaultImport.ts",
116117
"../services/codefixes/fixAddModuleReferTypeMissingTypeof.ts",
118+
"../services/codefixes/convertToMappedObjectType.ts",
117119
"../services/refactors/extractSymbol.ts",
118120
"../services/refactors/generateGetAccessorAndSetAccessor.ts",
119121
"../services/refactors/moveToNewFile.ts",

src/server/tsconfig.library.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"../services/documentRegistry.ts",
6666
"../services/importTracker.ts",
6767
"../services/findAllReferences.ts",
68+
"../services/getEditsForFileRename.ts",
6869
"../services/goToDefinition.ts",
6970
"../services/jsDoc.ts",
7071
"../services/semver.ts",
@@ -120,6 +121,7 @@
120121
"../services/codefixes/requireInTs.ts",
121122
"../services/codefixes/useDefaultImport.ts",
122123
"../services/codefixes/fixAddModuleReferTypeMissingTypeof.ts",
124+
"../services/codefixes/convertToMappedObjectType.ts",
123125
"../services/refactors/extractSymbol.ts",
124126
"../services/refactors/generateGetAccessorAndSetAccessor.ts",
125127
"../services/refactors/moveToNewFile.ts",

0 commit comments

Comments
 (0)