typescript 4.5.0-dev.20210914 → 4.5.0-dev.20210919
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cs/diagnosticMessages.generated.json +6 -0
- package/lib/de/diagnosticMessages.generated.json +6 -0
- package/lib/es/diagnosticMessages.generated.json +6 -0
- package/lib/fr/diagnosticMessages.generated.json +6 -0
- package/lib/it/diagnosticMessages.generated.json +6 -0
- package/lib/ja/diagnosticMessages.generated.json +6 -0
- package/lib/ko/diagnosticMessages.generated.json +6 -0
- package/lib/lib.es2018.intl.d.ts +2 -2
- package/lib/lib.es5.d.ts +5 -7
- package/lib/pl/diagnosticMessages.generated.json +6 -0
- package/lib/pt-br/diagnosticMessages.generated.json +6 -0
- package/lib/ru/diagnosticMessages.generated.json +6 -0
- package/lib/tr/diagnosticMessages.generated.json +6 -0
- package/lib/tsc.js +90 -23
- package/lib/tsserver.js +118 -32
- package/lib/tsserverlibrary.d.ts +2 -2
- package/lib/tsserverlibrary.js +118 -32
- package/lib/typescript.d.ts +2 -2
- package/lib/typescript.js +118 -32
- package/lib/typescriptServices.d.ts +2 -2
- package/lib/typescriptServices.js +118 -32
- package/lib/typingsInstaller.js +94 -24
- package/lib/zh-cn/diagnosticMessages.generated.json +6 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +6 -0
- package/package.json +2 -2
package/lib/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20210919";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -8837,6 +8837,7 @@ var ts;
|
|
|
8837
8837
|
Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."),
|
|
8838
8838
|
Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
|
|
8839
8839
|
Namespace_name_cannot_be_0: diag(2819, ts.DiagnosticCategory.Error, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
|
|
8840
|
+
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
8840
8841
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8841
8842
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8842
8843
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -8938,6 +8939,11 @@ var ts;
|
|
|
8938
8939
|
This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0: diag(4116, ts.DiagnosticCategory.Error, "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116", "This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),
|
|
8939
8940
|
This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4117, ts.DiagnosticCategory.Error, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
8940
8941
|
The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized: diag(4118, ts.DiagnosticCategory.Error, "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118", "The type of this node cannot be serialized because its property '{0}' cannot be serialized."),
|
|
8942
|
+
This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4119, ts.DiagnosticCategory.Error, "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119", "This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),
|
|
8943
|
+
This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4120, ts.DiagnosticCategory.Error, "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120", "This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),
|
|
8944
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),
|
|
8945
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
8946
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
8941
8947
|
The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
8942
8948
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
8943
8949
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -20872,6 +20878,15 @@ var ts;
|
|
|
20872
20878
|
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
|
20873
20879
|
}
|
|
20874
20880
|
ts.isInfinityOrNaNString = isInfinityOrNaNString;
|
|
20881
|
+
function isCatchClauseVariableDeclaration(node) {
|
|
20882
|
+
return node.kind === 252 /* VariableDeclaration */ && node.parent.kind === 290 /* CatchClause */;
|
|
20883
|
+
}
|
|
20884
|
+
ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration;
|
|
20885
|
+
function isParameterOrCatchClauseVariable(symbol) {
|
|
20886
|
+
var declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
|
|
20887
|
+
return !!declaration && (ts.isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
|
|
20888
|
+
}
|
|
20889
|
+
ts.isParameterOrCatchClauseVariable = isParameterOrCatchClauseVariable;
|
|
20875
20890
|
})(ts || (ts = {}));
|
|
20876
20891
|
/* @internal */
|
|
20877
20892
|
var ts;
|
|
@@ -62132,6 +62147,13 @@ var ts;
|
|
|
62132
62147
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;
|
|
62133
62148
|
}
|
|
62134
62149
|
else {
|
|
62150
|
+
if (source.flags & 128 /* StringLiteral */ && target.flags & 1048576 /* Union */) {
|
|
62151
|
+
var suggestedType = getSuggestedTypeForNonexistentStringLiteralType(source, target);
|
|
62152
|
+
if (suggestedType) {
|
|
62153
|
+
reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2, generalizedSourceType, targetType, typeToString(suggestedType));
|
|
62154
|
+
return;
|
|
62155
|
+
}
|
|
62156
|
+
}
|
|
62135
62157
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1;
|
|
62136
62158
|
}
|
|
62137
62159
|
}
|
|
@@ -67292,9 +67314,10 @@ var ts;
|
|
|
67292
67314
|
}
|
|
67293
67315
|
function isConstantReference(node) {
|
|
67294
67316
|
switch (node.kind) {
|
|
67295
|
-
case 79 /* Identifier */:
|
|
67317
|
+
case 79 /* Identifier */: {
|
|
67296
67318
|
var symbol = getResolvedSymbol(node);
|
|
67297
|
-
return isConstVariable(symbol) ||
|
|
67319
|
+
return isConstVariable(symbol) || ts.isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
|
|
67320
|
+
}
|
|
67298
67321
|
case 204 /* PropertyAccessExpression */:
|
|
67299
67322
|
case 205 /* ElementAccessExpression */:
|
|
67300
67323
|
// The resolvedSymbol property is initialized by checkPropertyAccess or checkElementAccess before we get here.
|
|
@@ -68376,35 +68399,37 @@ var ts;
|
|
|
68376
68399
|
node.kind === 165 /* PropertyDeclaration */;
|
|
68377
68400
|
});
|
|
68378
68401
|
}
|
|
68379
|
-
// Check if a parameter is assigned anywhere
|
|
68380
|
-
function
|
|
68402
|
+
// Check if a parameter or catch variable is assigned anywhere
|
|
68403
|
+
function isSymbolAssigned(symbol) {
|
|
68381
68404
|
if (!symbol.valueDeclaration) {
|
|
68382
68405
|
return false;
|
|
68383
68406
|
}
|
|
68384
|
-
var
|
|
68385
|
-
var links = getNodeLinks(
|
|
68407
|
+
var parent = ts.getRootDeclaration(symbol.valueDeclaration).parent;
|
|
68408
|
+
var links = getNodeLinks(parent);
|
|
68386
68409
|
if (!(links.flags & 8388608 /* AssignmentsMarked */)) {
|
|
68387
68410
|
links.flags |= 8388608 /* AssignmentsMarked */;
|
|
68388
|
-
if (!hasParentWithAssignmentsMarked(
|
|
68389
|
-
|
|
68411
|
+
if (!hasParentWithAssignmentsMarked(parent)) {
|
|
68412
|
+
markNodeAssignments(parent);
|
|
68390
68413
|
}
|
|
68391
68414
|
}
|
|
68392
68415
|
return symbol.isAssigned || false;
|
|
68393
68416
|
}
|
|
68394
68417
|
function hasParentWithAssignmentsMarked(node) {
|
|
68395
|
-
return !!ts.findAncestor(node.parent, function (node) {
|
|
68418
|
+
return !!ts.findAncestor(node.parent, function (node) {
|
|
68419
|
+
return (ts.isFunctionLike(node) || ts.isCatchClause(node)) && !!(getNodeLinks(node).flags & 8388608 /* AssignmentsMarked */);
|
|
68420
|
+
});
|
|
68396
68421
|
}
|
|
68397
|
-
function
|
|
68422
|
+
function markNodeAssignments(node) {
|
|
68398
68423
|
if (node.kind === 79 /* Identifier */) {
|
|
68399
68424
|
if (ts.isAssignmentTarget(node)) {
|
|
68400
68425
|
var symbol = getResolvedSymbol(node);
|
|
68401
|
-
if (
|
|
68426
|
+
if (ts.isParameterOrCatchClauseVariable(symbol)) {
|
|
68402
68427
|
symbol.isAssigned = true;
|
|
68403
68428
|
}
|
|
68404
68429
|
}
|
|
68405
68430
|
}
|
|
68406
68431
|
else {
|
|
68407
|
-
ts.forEachChild(node,
|
|
68432
|
+
ts.forEachChild(node, markNodeAssignments);
|
|
68408
68433
|
}
|
|
68409
68434
|
}
|
|
68410
68435
|
function isConstVariable(symbol) {
|
|
@@ -68464,7 +68489,19 @@ var ts;
|
|
|
68464
68489
|
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
|
|
68465
68490
|
}
|
|
68466
68491
|
function isExportOrExportExpression(location) {
|
|
68467
|
-
return !!ts.findAncestor(location, function (
|
|
68492
|
+
return !!ts.findAncestor(location, function (n) {
|
|
68493
|
+
var parent = n.parent;
|
|
68494
|
+
if (parent === undefined) {
|
|
68495
|
+
return "quit";
|
|
68496
|
+
}
|
|
68497
|
+
if (ts.isExportAssignment(parent)) {
|
|
68498
|
+
return parent.expression === n && ts.isEntityNameExpression(n);
|
|
68499
|
+
}
|
|
68500
|
+
if (ts.isExportSpecifier(parent)) {
|
|
68501
|
+
return parent.name === n || parent.propertyName === n;
|
|
68502
|
+
}
|
|
68503
|
+
return false;
|
|
68504
|
+
});
|
|
68468
68505
|
}
|
|
68469
68506
|
function markAliasReferenced(symbol, location) {
|
|
68470
68507
|
if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* Value */) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {
|
|
@@ -68613,7 +68650,7 @@ var ts;
|
|
|
68613
68650
|
// analysis to include the immediately enclosing function.
|
|
68614
68651
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 211 /* FunctionExpression */ ||
|
|
68615
68652
|
flowContainer.kind === 212 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) &&
|
|
68616
|
-
(isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !
|
|
68653
|
+
(isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !isSymbolAssigned(localOrExportSymbol))) {
|
|
68617
68654
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
68618
68655
|
}
|
|
68619
68656
|
// We only look for uninitialized variables in strict null checking mode, and only when we can analyze
|
|
@@ -71843,6 +71880,10 @@ var ts;
|
|
|
71843
71880
|
}
|
|
71844
71881
|
return suggestion;
|
|
71845
71882
|
}
|
|
71883
|
+
function getSuggestedTypeForNonexistentStringLiteralType(source, target) {
|
|
71884
|
+
var candidates = target.types.filter(function (type) { return !!(type.flags & 128 /* StringLiteral */); });
|
|
71885
|
+
return ts.getSpellingSuggestion(source.value, candidates, function (type) { return type.value; });
|
|
71886
|
+
}
|
|
71846
71887
|
/**
|
|
71847
71888
|
* Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough.
|
|
71848
71889
|
* Names less than length 3 only check for case-insensitive equality, not levenshtein distance.
|
|
@@ -80671,6 +80712,7 @@ var ts;
|
|
|
80671
80712
|
function checkClassMember(member, memberIsParameterProperty) {
|
|
80672
80713
|
var hasOverride = ts.hasOverrideModifier(member);
|
|
80673
80714
|
var hasStatic = ts.isStatic(member);
|
|
80715
|
+
var isJs = ts.isInJSFile(member);
|
|
80674
80716
|
if (baseWithThis && (hasOverride || compilerOptions.noImplicitOverride)) {
|
|
80675
80717
|
var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member);
|
|
80676
80718
|
if (!declaredProp) {
|
|
@@ -80684,8 +80726,12 @@ var ts;
|
|
|
80684
80726
|
if (prop && !baseProp && hasOverride) {
|
|
80685
80727
|
var suggestion = getSuggestedSymbolForNonexistentClassMember(ts.symbolName(declaredProp), baseType);
|
|
80686
80728
|
suggestion ?
|
|
80687
|
-
error(member,
|
|
80688
|
-
|
|
80729
|
+
error(member, isJs ?
|
|
80730
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 :
|
|
80731
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, baseClassName, symbolToString(suggestion)) :
|
|
80732
|
+
error(member, isJs ?
|
|
80733
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 :
|
|
80734
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName);
|
|
80689
80735
|
}
|
|
80690
80736
|
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) {
|
|
80691
80737
|
var baseHasAbstract = ts.some(baseProp.declarations, ts.hasAbstractModifier);
|
|
@@ -80694,8 +80740,12 @@ var ts;
|
|
|
80694
80740
|
}
|
|
80695
80741
|
if (!baseHasAbstract) {
|
|
80696
80742
|
var diag = memberIsParameterProperty ?
|
|
80697
|
-
|
|
80698
|
-
|
|
80743
|
+
isJs ?
|
|
80744
|
+
ts.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
80745
|
+
ts.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 :
|
|
80746
|
+
isJs ?
|
|
80747
|
+
ts.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
80748
|
+
ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;
|
|
80699
80749
|
error(member, diag, baseClassName);
|
|
80700
80750
|
}
|
|
80701
80751
|
else if (ts.hasAbstractModifier(member) && baseHasAbstract) {
|
|
@@ -80705,7 +80755,9 @@ var ts;
|
|
|
80705
80755
|
}
|
|
80706
80756
|
else if (hasOverride) {
|
|
80707
80757
|
var className = typeToString(type);
|
|
80708
|
-
error(member,
|
|
80758
|
+
error(member, isJs ?
|
|
80759
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class :
|
|
80760
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className);
|
|
80709
80761
|
}
|
|
80710
80762
|
}
|
|
80711
80763
|
}
|
|
@@ -112211,7 +112263,7 @@ var ts;
|
|
|
112211
112263
|
}
|
|
112212
112264
|
else {
|
|
112213
112265
|
ts.forEach(options.lib, function (libFileName, index) {
|
|
112214
|
-
processRootFile(
|
|
112266
|
+
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.LibFile, index: index });
|
|
112215
112267
|
});
|
|
112216
112268
|
}
|
|
112217
112269
|
}
|
|
@@ -112873,7 +112925,7 @@ var ts;
|
|
|
112873
112925
|
return equalityComparer(file.fileName, getDefaultLibraryFileName());
|
|
112874
112926
|
}
|
|
112875
112927
|
else {
|
|
112876
|
-
return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName,
|
|
112928
|
+
return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName, pathForLibFile(libFileName)); });
|
|
112877
112929
|
}
|
|
112878
112930
|
}
|
|
112879
112931
|
function getDiagnosticsProducingTypeChecker() {
|
|
@@ -113455,7 +113507,7 @@ var ts;
|
|
|
113455
113507
|
var libName = ts.toFileNameLowerCase(ref.fileName);
|
|
113456
113508
|
var libFileName = ts.libMap.get(libName);
|
|
113457
113509
|
if (libFileName) {
|
|
113458
|
-
return getSourceFile(
|
|
113510
|
+
return getSourceFile(pathForLibFile(libFileName));
|
|
113459
113511
|
}
|
|
113460
113512
|
}
|
|
113461
113513
|
/** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */
|
|
@@ -113866,13 +113918,31 @@ var ts;
|
|
|
113866
113918
|
resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective);
|
|
113867
113919
|
}
|
|
113868
113920
|
}
|
|
113921
|
+
function pathForLibFile(libFileName) {
|
|
113922
|
+
// Support resolving to lib.dom.d.ts -> @typescript/dom, and
|
|
113923
|
+
// lib.dom.iterable.d.ts -> @typescript/dom/iterable
|
|
113924
|
+
// lib.es2015.symbol.wellknown.d.ts -> @typescript/es2015/symbol-wellknown
|
|
113925
|
+
var components = libFileName.split(".");
|
|
113926
|
+
var path = components[1];
|
|
113927
|
+
var i = 2;
|
|
113928
|
+
while (components[i] && components[i] !== "d") {
|
|
113929
|
+
path += (i === 2 ? "/" : "-") + components[i];
|
|
113930
|
+
i++;
|
|
113931
|
+
}
|
|
113932
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
|
|
113933
|
+
var localOverrideModuleResult = ts.resolveModuleName("@typescript/" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
113934
|
+
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
113935
|
+
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
113936
|
+
}
|
|
113937
|
+
return ts.combinePaths(defaultLibraryPath, libFileName);
|
|
113938
|
+
}
|
|
113869
113939
|
function processLibReferenceDirectives(file) {
|
|
113870
113940
|
ts.forEach(file.libReferenceDirectives, function (libReference, index) {
|
|
113871
113941
|
var libName = ts.toFileNameLowerCase(libReference.fileName);
|
|
113872
113942
|
var libFileName = ts.libMap.get(libName);
|
|
113873
113943
|
if (libFileName) {
|
|
113874
113944
|
// we ignore any 'no-default-lib' reference set on this file.
|
|
113875
|
-
processRootFile(
|
|
113945
|
+
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ true, { kind: ts.FileIncludeKind.LibReferenceDirective, file: file.path, index: index, });
|
|
113876
113946
|
}
|
|
113877
113947
|
else {
|
|
113878
113948
|
var unqualifiedLibName = ts.removeSuffix(ts.removePrefix(libName, "lib."), ".d.ts");
|
|
@@ -140891,11 +140961,11 @@ var ts;
|
|
|
140891
140961
|
var leadingTrivia = formattingScanner.getCurrentLeadingTrivia();
|
|
140892
140962
|
if (leadingTrivia) {
|
|
140893
140963
|
indentTriviaItems(leadingTrivia, indentation, /*indentNextTokenOrTrivia*/ false, function (item) { return processRange(item, sourceFile.getLineAndCharacterOfPosition(item.pos), enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); });
|
|
140964
|
+
if (options.trimTrailingWhitespace !== false) {
|
|
140965
|
+
trimTrailingWhitespacesForRemainingRange(leadingTrivia);
|
|
140966
|
+
}
|
|
140894
140967
|
}
|
|
140895
140968
|
}
|
|
140896
|
-
if (options.trimTrailingWhitespace !== false) {
|
|
140897
|
-
trimTrailingWhitespacesForRemainingRange();
|
|
140898
|
-
}
|
|
140899
140969
|
return edits;
|
|
140900
140970
|
// local functions
|
|
140901
140971
|
/** Tries to compute the indentation for a list element.
|
|
@@ -141464,12 +141534,27 @@ var ts;
|
|
|
141464
141534
|
return -1;
|
|
141465
141535
|
}
|
|
141466
141536
|
/**
|
|
141467
|
-
* Trimming will be done for lines after the previous range
|
|
141537
|
+
* Trimming will be done for lines after the previous range.
|
|
141538
|
+
* Exclude comments as they had been previously processed.
|
|
141468
141539
|
*/
|
|
141469
|
-
function trimTrailingWhitespacesForRemainingRange() {
|
|
141470
|
-
var
|
|
141471
|
-
var
|
|
141472
|
-
|
|
141540
|
+
function trimTrailingWhitespacesForRemainingRange(trivias) {
|
|
141541
|
+
var startPos = previousRange ? previousRange.end : originalRange.pos;
|
|
141542
|
+
for (var _i = 0, trivias_1 = trivias; _i < trivias_1.length; _i++) {
|
|
141543
|
+
var trivia = trivias_1[_i];
|
|
141544
|
+
if (ts.isComment(trivia.kind)) {
|
|
141545
|
+
if (startPos < trivia.pos) {
|
|
141546
|
+
trimTrailingWitespacesForPositions(startPos, trivia.pos - 1, previousRange);
|
|
141547
|
+
}
|
|
141548
|
+
startPos = trivia.end + 1;
|
|
141549
|
+
}
|
|
141550
|
+
}
|
|
141551
|
+
if (startPos < originalRange.end) {
|
|
141552
|
+
trimTrailingWitespacesForPositions(startPos, originalRange.end, previousRange);
|
|
141553
|
+
}
|
|
141554
|
+
}
|
|
141555
|
+
function trimTrailingWitespacesForPositions(startPos, endPos, previousRange) {
|
|
141556
|
+
var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line;
|
|
141557
|
+
var endLine = sourceFile.getLineAndCharacterOfPosition(endPos).line;
|
|
141473
141558
|
trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange);
|
|
141474
141559
|
}
|
|
141475
141560
|
function recordDelete(start, len) {
|
|
@@ -147414,6 +147499,7 @@ var ts;
|
|
|
147414
147499
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
|
|
147415
147500
|
ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,
|
|
147416
147501
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,
|
|
147502
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,
|
|
147417
147503
|
// for JSX class components
|
|
147418
147504
|
ts.Diagnostics.No_overload_matches_this_call.code,
|
|
147419
147505
|
// for JSX FC
|
package/lib/typescript.d.ts
CHANGED
|
@@ -2722,8 +2722,8 @@ declare namespace ts {
|
|
|
2722
2722
|
root: ConditionalRoot;
|
|
2723
2723
|
checkType: Type;
|
|
2724
2724
|
extendsType: Type;
|
|
2725
|
-
resolvedTrueType
|
|
2726
|
-
resolvedFalseType
|
|
2725
|
+
resolvedTrueType?: Type;
|
|
2726
|
+
resolvedFalseType?: Type;
|
|
2727
2727
|
}
|
|
2728
2728
|
export interface TemplateLiteralType extends InstantiableType {
|
|
2729
2729
|
texts: readonly string[];
|