typescript 5.7.0-dev.20240820 → 5.7.0-dev.20240821
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/tsc.js +33 -14
- package/lib/typescript.js +44 -27
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.7";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240821`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -17134,6 +17134,9 @@ function accessKind(node) {
|
|
|
17134
17134
|
return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent);
|
|
17135
17135
|
case 209 /* ArrayLiteralExpression */:
|
|
17136
17136
|
return accessKind(parent);
|
|
17137
|
+
case 249 /* ForInStatement */:
|
|
17138
|
+
case 250 /* ForOfStatement */:
|
|
17139
|
+
return node === parent.initializer ? 1 /* Write */ : 0 /* Read */;
|
|
17137
17140
|
default:
|
|
17138
17141
|
return 0 /* Read */;
|
|
17139
17142
|
}
|
|
@@ -69774,6 +69777,12 @@ function createTypeChecker(host) {
|
|
|
69774
69777
|
function getControlFlowContainer(node) {
|
|
69775
69778
|
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 307 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
|
|
69776
69779
|
}
|
|
69780
|
+
function isSymbolAssignedDefinitely(symbol) {
|
|
69781
|
+
if (symbol.lastAssignmentPos !== void 0) {
|
|
69782
|
+
return symbol.lastAssignmentPos < 0;
|
|
69783
|
+
}
|
|
69784
|
+
return isSymbolAssigned(symbol) && symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0;
|
|
69785
|
+
}
|
|
69777
69786
|
function isSymbolAssigned(symbol) {
|
|
69778
69787
|
return !isPastLastAssignment(
|
|
69779
69788
|
symbol,
|
|
@@ -69793,7 +69802,7 @@ function createTypeChecker(host) {
|
|
|
69793
69802
|
markNodeAssignments(parent);
|
|
69794
69803
|
}
|
|
69795
69804
|
}
|
|
69796
|
-
return !symbol.lastAssignmentPos || location && symbol.lastAssignmentPos < location.pos;
|
|
69805
|
+
return !symbol.lastAssignmentPos || location && Math.abs(symbol.lastAssignmentPos) < location.pos;
|
|
69797
69806
|
}
|
|
69798
69807
|
function isSomeSymbolAssigned(rootDeclaration) {
|
|
69799
69808
|
Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration));
|
|
@@ -69814,12 +69823,19 @@ function createTypeChecker(host) {
|
|
|
69814
69823
|
function markNodeAssignments(node) {
|
|
69815
69824
|
switch (node.kind) {
|
|
69816
69825
|
case 80 /* Identifier */:
|
|
69817
|
-
|
|
69826
|
+
const assigmentTarget = getAssignmentTargetKind(node);
|
|
69827
|
+
if (assigmentTarget !== 0 /* None */) {
|
|
69818
69828
|
const symbol = getResolvedSymbol(node);
|
|
69819
|
-
|
|
69820
|
-
|
|
69821
|
-
|
|
69822
|
-
|
|
69829
|
+
const hasDefiniteAssignment = assigmentTarget === 1 /* Definite */ || symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0;
|
|
69830
|
+
if (isParameterOrMutableLocalVariable(symbol)) {
|
|
69831
|
+
if (symbol.lastAssignmentPos === void 0 || Math.abs(symbol.lastAssignmentPos) !== Number.MAX_VALUE) {
|
|
69832
|
+
const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
|
|
69833
|
+
const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
|
|
69834
|
+
symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
|
|
69835
|
+
}
|
|
69836
|
+
if (hasDefiniteAssignment && symbol.lastAssignmentPos > 0) {
|
|
69837
|
+
symbol.lastAssignmentPos *= -1;
|
|
69838
|
+
}
|
|
69823
69839
|
}
|
|
69824
69840
|
}
|
|
69825
69841
|
return;
|
|
@@ -69836,7 +69852,8 @@ function createTypeChecker(host) {
|
|
|
69836
69852
|
true
|
|
69837
69853
|
);
|
|
69838
69854
|
if (symbol && isParameterOrMutableLocalVariable(symbol)) {
|
|
69839
|
-
symbol.lastAssignmentPos
|
|
69855
|
+
const sign = symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0 ? -1 : 1;
|
|
69856
|
+
symbol.lastAssignmentPos = sign * Number.MAX_VALUE;
|
|
69840
69857
|
}
|
|
69841
69858
|
}
|
|
69842
69859
|
return;
|
|
@@ -70420,6 +70437,7 @@ function createTypeChecker(host) {
|
|
|
70420
70437
|
}
|
|
70421
70438
|
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
70422
70439
|
let declaration = localOrExportSymbol.valueDeclaration;
|
|
70440
|
+
const immediateDeclaration = declaration;
|
|
70423
70441
|
if (declaration && declaration.kind === 208 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent) => parent === declaration.parent)) {
|
|
70424
70442
|
return nonInferrableAnyType;
|
|
70425
70443
|
}
|
|
@@ -70465,7 +70483,8 @@ function createTypeChecker(host) {
|
|
|
70465
70483
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) {
|
|
70466
70484
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
70467
70485
|
}
|
|
70468
|
-
const
|
|
70486
|
+
const isNeverInitialized = immediateDeclaration && isVariableDeclaration(immediateDeclaration) && !immediateDeclaration.initializer && !immediateDeclaration.exclamationToken && isMutableLocalVariableDeclaration(immediateDeclaration) && !isSymbolAssignedDefinitely(symbol);
|
|
70487
|
+
const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
|
|
70469
70488
|
const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type);
|
|
70470
70489
|
const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
70471
70490
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -91469,7 +91488,7 @@ function transformTypeScript(context) {
|
|
|
91469
91488
|
let currentNamespaceContainerName;
|
|
91470
91489
|
let currentLexicalScope;
|
|
91471
91490
|
let currentScopeFirstDeclarationsOfName;
|
|
91472
|
-
let enabledSubstitutions
|
|
91491
|
+
let enabledSubstitutions = 0 /* None */;
|
|
91473
91492
|
let applicableSubstitutions;
|
|
91474
91493
|
return transformSourceFileOrBundle;
|
|
91475
91494
|
function transformSourceFileOrBundle(node) {
|
|
@@ -93277,7 +93296,7 @@ function transformClassFields(context) {
|
|
|
93277
93296
|
const previousOnEmitNode = context.onEmitNode;
|
|
93278
93297
|
context.onEmitNode = onEmitNode;
|
|
93279
93298
|
let shouldTransformPrivateStaticElementsInFile = false;
|
|
93280
|
-
let enabledSubstitutions
|
|
93299
|
+
let enabledSubstitutions = 0 /* None */;
|
|
93281
93300
|
let classAliases;
|
|
93282
93301
|
let pendingExpressions;
|
|
93283
93302
|
let pendingStatements;
|
|
@@ -98206,7 +98225,7 @@ function transformES2017(context) {
|
|
|
98206
98225
|
const resolver = context.getEmitResolver();
|
|
98207
98226
|
const compilerOptions = context.getCompilerOptions();
|
|
98208
98227
|
const languageVersion = getEmitScriptTarget(compilerOptions);
|
|
98209
|
-
let enabledSubstitutions
|
|
98228
|
+
let enabledSubstitutions = 0 /* None */;
|
|
98210
98229
|
let enclosingSuperContainerFlags = 0;
|
|
98211
98230
|
let enclosingFunctionParameterNames;
|
|
98212
98231
|
let capturedSuperProperties;
|
|
@@ -99081,7 +99100,7 @@ function transformES2018(context) {
|
|
|
99081
99100
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
99082
99101
|
context.onSubstituteNode = onSubstituteNode;
|
|
99083
99102
|
let exportedVariableStatement = false;
|
|
99084
|
-
let enabledSubstitutions
|
|
99103
|
+
let enabledSubstitutions = 0 /* None */;
|
|
99085
99104
|
let enclosingFunctionFlags;
|
|
99086
99105
|
let parametersWithPrecedingObjectRestOrSpread;
|
|
99087
99106
|
let enclosingSuperContainerFlags = 0;
|
|
@@ -102216,7 +102235,7 @@ function transformES2015(context) {
|
|
|
102216
102235
|
);
|
|
102217
102236
|
}
|
|
102218
102237
|
let convertedLoopState;
|
|
102219
|
-
let enabledSubstitutions
|
|
102238
|
+
let enabledSubstitutions = 0 /* None */;
|
|
102220
102239
|
return chainBundle(context, transformSourceFile);
|
|
102221
102240
|
function transformSourceFile(node) {
|
|
102222
102241
|
if (node.isDeclarationFile) {
|
package/lib/typescript.js
CHANGED
|
@@ -2263,7 +2263,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2263
2263
|
|
|
2264
2264
|
// src/compiler/corePublic.ts
|
|
2265
2265
|
var versionMajorMinor = "5.7";
|
|
2266
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2266
|
+
var version = `${versionMajorMinor}.0-dev.20240821`;
|
|
2267
2267
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2268
2268
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2269
2269
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -21026,6 +21026,9 @@ function accessKind(node) {
|
|
|
21026
21026
|
return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent);
|
|
21027
21027
|
case 209 /* ArrayLiteralExpression */:
|
|
21028
21028
|
return accessKind(parent2);
|
|
21029
|
+
case 249 /* ForInStatement */:
|
|
21030
|
+
case 250 /* ForOfStatement */:
|
|
21031
|
+
return node === parent2.initializer ? 1 /* Write */ : 0 /* Read */;
|
|
21029
21032
|
default:
|
|
21030
21033
|
return 0 /* Read */;
|
|
21031
21034
|
}
|
|
@@ -74394,6 +74397,12 @@ function createTypeChecker(host) {
|
|
|
74394
74397
|
function getControlFlowContainer(node) {
|
|
74395
74398
|
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 307 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
|
|
74396
74399
|
}
|
|
74400
|
+
function isSymbolAssignedDefinitely(symbol) {
|
|
74401
|
+
if (symbol.lastAssignmentPos !== void 0) {
|
|
74402
|
+
return symbol.lastAssignmentPos < 0;
|
|
74403
|
+
}
|
|
74404
|
+
return isSymbolAssigned(symbol) && symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0;
|
|
74405
|
+
}
|
|
74397
74406
|
function isSymbolAssigned(symbol) {
|
|
74398
74407
|
return !isPastLastAssignment(
|
|
74399
74408
|
symbol,
|
|
@@ -74413,7 +74422,7 @@ function createTypeChecker(host) {
|
|
|
74413
74422
|
markNodeAssignments(parent2);
|
|
74414
74423
|
}
|
|
74415
74424
|
}
|
|
74416
|
-
return !symbol.lastAssignmentPos || location && symbol.lastAssignmentPos < location.pos;
|
|
74425
|
+
return !symbol.lastAssignmentPos || location && Math.abs(symbol.lastAssignmentPos) < location.pos;
|
|
74417
74426
|
}
|
|
74418
74427
|
function isSomeSymbolAssigned(rootDeclaration) {
|
|
74419
74428
|
Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration));
|
|
@@ -74434,12 +74443,19 @@ function createTypeChecker(host) {
|
|
|
74434
74443
|
function markNodeAssignments(node) {
|
|
74435
74444
|
switch (node.kind) {
|
|
74436
74445
|
case 80 /* Identifier */:
|
|
74437
|
-
|
|
74446
|
+
const assigmentTarget = getAssignmentTargetKind(node);
|
|
74447
|
+
if (assigmentTarget !== 0 /* None */) {
|
|
74438
74448
|
const symbol = getResolvedSymbol(node);
|
|
74439
|
-
|
|
74440
|
-
|
|
74441
|
-
|
|
74442
|
-
|
|
74449
|
+
const hasDefiniteAssignment = assigmentTarget === 1 /* Definite */ || symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0;
|
|
74450
|
+
if (isParameterOrMutableLocalVariable(symbol)) {
|
|
74451
|
+
if (symbol.lastAssignmentPos === void 0 || Math.abs(symbol.lastAssignmentPos) !== Number.MAX_VALUE) {
|
|
74452
|
+
const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
|
|
74453
|
+
const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
|
|
74454
|
+
symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
|
|
74455
|
+
}
|
|
74456
|
+
if (hasDefiniteAssignment && symbol.lastAssignmentPos > 0) {
|
|
74457
|
+
symbol.lastAssignmentPos *= -1;
|
|
74458
|
+
}
|
|
74443
74459
|
}
|
|
74444
74460
|
}
|
|
74445
74461
|
return;
|
|
@@ -74456,7 +74472,8 @@ function createTypeChecker(host) {
|
|
|
74456
74472
|
true
|
|
74457
74473
|
);
|
|
74458
74474
|
if (symbol && isParameterOrMutableLocalVariable(symbol)) {
|
|
74459
|
-
symbol.lastAssignmentPos
|
|
74475
|
+
const sign = symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0 ? -1 : 1;
|
|
74476
|
+
symbol.lastAssignmentPos = sign * Number.MAX_VALUE;
|
|
74460
74477
|
}
|
|
74461
74478
|
}
|
|
74462
74479
|
return;
|
|
@@ -75040,6 +75057,7 @@ function createTypeChecker(host) {
|
|
|
75040
75057
|
}
|
|
75041
75058
|
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
75042
75059
|
let declaration = localOrExportSymbol.valueDeclaration;
|
|
75060
|
+
const immediateDeclaration = declaration;
|
|
75043
75061
|
if (declaration && declaration.kind === 208 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent2) => parent2 === declaration.parent)) {
|
|
75044
75062
|
return nonInferrableAnyType;
|
|
75045
75063
|
}
|
|
@@ -75085,7 +75103,8 @@ function createTypeChecker(host) {
|
|
|
75085
75103
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) {
|
|
75086
75104
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
75087
75105
|
}
|
|
75088
|
-
const
|
|
75106
|
+
const isNeverInitialized = immediateDeclaration && isVariableDeclaration(immediateDeclaration) && !immediateDeclaration.initializer && !immediateDeclaration.exclamationToken && isMutableLocalVariableDeclaration(immediateDeclaration) && !isSymbolAssignedDefinitely(symbol);
|
|
75107
|
+
const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
|
|
75089
75108
|
const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type);
|
|
75090
75109
|
const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
75091
75110
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
@@ -96271,7 +96290,7 @@ function transformTypeScript(context) {
|
|
|
96271
96290
|
let currentNamespaceContainerName;
|
|
96272
96291
|
let currentLexicalScope;
|
|
96273
96292
|
let currentScopeFirstDeclarationsOfName;
|
|
96274
|
-
let enabledSubstitutions
|
|
96293
|
+
let enabledSubstitutions = 0 /* None */;
|
|
96275
96294
|
let applicableSubstitutions;
|
|
96276
96295
|
return transformSourceFileOrBundle;
|
|
96277
96296
|
function transformSourceFileOrBundle(node) {
|
|
@@ -98079,7 +98098,7 @@ function transformClassFields(context) {
|
|
|
98079
98098
|
const previousOnEmitNode = context.onEmitNode;
|
|
98080
98099
|
context.onEmitNode = onEmitNode;
|
|
98081
98100
|
let shouldTransformPrivateStaticElementsInFile = false;
|
|
98082
|
-
let enabledSubstitutions
|
|
98101
|
+
let enabledSubstitutions = 0 /* None */;
|
|
98083
98102
|
let classAliases;
|
|
98084
98103
|
let pendingExpressions;
|
|
98085
98104
|
let pendingStatements;
|
|
@@ -103008,7 +103027,7 @@ function transformES2017(context) {
|
|
|
103008
103027
|
const resolver = context.getEmitResolver();
|
|
103009
103028
|
const compilerOptions = context.getCompilerOptions();
|
|
103010
103029
|
const languageVersion = getEmitScriptTarget(compilerOptions);
|
|
103011
|
-
let enabledSubstitutions
|
|
103030
|
+
let enabledSubstitutions = 0 /* None */;
|
|
103012
103031
|
let enclosingSuperContainerFlags = 0;
|
|
103013
103032
|
let enclosingFunctionParameterNames;
|
|
103014
103033
|
let capturedSuperProperties;
|
|
@@ -103883,7 +103902,7 @@ function transformES2018(context) {
|
|
|
103883
103902
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
103884
103903
|
context.onSubstituteNode = onSubstituteNode;
|
|
103885
103904
|
let exportedVariableStatement = false;
|
|
103886
|
-
let enabledSubstitutions
|
|
103905
|
+
let enabledSubstitutions = 0 /* None */;
|
|
103887
103906
|
let enclosingFunctionFlags;
|
|
103888
103907
|
let parametersWithPrecedingObjectRestOrSpread;
|
|
103889
103908
|
let enclosingSuperContainerFlags = 0;
|
|
@@ -107018,7 +107037,7 @@ function transformES2015(context) {
|
|
|
107018
107037
|
);
|
|
107019
107038
|
}
|
|
107020
107039
|
let convertedLoopState;
|
|
107021
|
-
let enabledSubstitutions
|
|
107040
|
+
let enabledSubstitutions = 0 /* None */;
|
|
107022
107041
|
return chainBundle(context, transformSourceFile);
|
|
107023
107042
|
function transformSourceFile(node) {
|
|
107024
107043
|
if (node.isDeclarationFile) {
|
|
@@ -184235,19 +184254,12 @@ var Project2 = class _Project {
|
|
|
184235
184254
|
}
|
|
184236
184255
|
/** @internal */
|
|
184237
184256
|
onAutoImportProviderSettingsChanged() {
|
|
184238
|
-
|
|
184239
|
-
if (this.autoImportProviderHost === false) {
|
|
184240
|
-
this.autoImportProviderHost = void 0;
|
|
184241
|
-
} else {
|
|
184242
|
-
(_a = this.autoImportProviderHost) == null ? void 0 : _a.markAsDirty();
|
|
184243
|
-
}
|
|
184257
|
+
this.markAutoImportProviderAsDirty();
|
|
184244
184258
|
}
|
|
184245
184259
|
/** @internal */
|
|
184246
184260
|
onPackageJsonChange() {
|
|
184247
184261
|
this.moduleSpecifierCache.clear();
|
|
184248
|
-
|
|
184249
|
-
this.autoImportProviderHost.markAsDirty();
|
|
184250
|
-
}
|
|
184262
|
+
this.markAutoImportProviderAsDirty();
|
|
184251
184263
|
}
|
|
184252
184264
|
/** @internal */
|
|
184253
184265
|
onFileAddedOrRemoved(isSymlink) {
|
|
@@ -185003,7 +185015,7 @@ var Project2 = class _Project {
|
|
|
185003
185015
|
if (dependencySelection) {
|
|
185004
185016
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider");
|
|
185005
185017
|
const start = timestamp();
|
|
185006
|
-
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry);
|
|
185018
|
+
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry) ?? false;
|
|
185007
185019
|
if (this.autoImportProviderHost) {
|
|
185008
185020
|
updateProjectIfDirty(this.autoImportProviderHost);
|
|
185009
185021
|
this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start);
|
|
@@ -185261,7 +185273,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
185261
185273
|
if (dependencyNames) {
|
|
185262
185274
|
const symlinkCache = hostProject.getSymlinkCache();
|
|
185263
185275
|
for (const name of arrayFrom(dependencyNames.keys())) {
|
|
185264
|
-
if (dependencySelection === 2 /* Auto */ && dependenciesAdded
|
|
185276
|
+
if (dependencySelection === 2 /* Auto */ && dependenciesAdded >= this.maxDependencies) {
|
|
185265
185277
|
hostProject.log(`AutoImportProviderProject: attempted to add more than ${this.maxDependencies} dependencies. Aborting.`);
|
|
185266
185278
|
return emptyArray;
|
|
185267
185279
|
}
|
|
@@ -188763,6 +188775,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
188763
188775
|
}
|
|
188764
188776
|
};
|
|
188765
188777
|
toRetainConfiguredProjects == null ? void 0 : toRetainConfiguredProjects.forEach(retainConfiguredProject);
|
|
188778
|
+
if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
|
|
188766
188779
|
this.inferredProjects.forEach(markOriginalProjectsAsUsed);
|
|
188767
188780
|
this.externalProjects.forEach(markOriginalProjectsAsUsed);
|
|
188768
188781
|
this.externalProjectToConfiguredProjectMap.forEach((projects, externalProjectName) => {
|
|
@@ -188770,7 +188783,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
188770
188783
|
projects.forEach(retainConfiguredProject);
|
|
188771
188784
|
}
|
|
188772
188785
|
});
|
|
188773
|
-
|
|
188786
|
+
if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
|
|
188787
|
+
forEachEntry(this.openFiles, (_projectRootPath, path) => {
|
|
188774
188788
|
if (openFilesWithRetainedConfiguredProject == null ? void 0 : openFilesWithRetainedConfiguredProject.has(path)) return;
|
|
188775
188789
|
const info = this.getScriptInfoForPath(path);
|
|
188776
188790
|
if (find(info.containingProjects, isExternalProject)) return;
|
|
@@ -188780,12 +188794,15 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
188780
188794
|
);
|
|
188781
188795
|
if (result == null ? void 0 : result.defaultProject) {
|
|
188782
188796
|
result == null ? void 0 : result.seenProjects.forEach(retainConfiguredProject);
|
|
188797
|
+
if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
|
|
188783
188798
|
}
|
|
188784
188799
|
});
|
|
188785
|
-
|
|
188800
|
+
if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
|
|
188801
|
+
forEachEntry(this.configuredProjects, (project) => {
|
|
188786
188802
|
if (toRemoveConfiguredProjects.has(project)) {
|
|
188787
188803
|
if (isPendingUpdate(project) || forEachReferencedProject(project, isRetained)) {
|
|
188788
188804
|
retainConfiguredProject(project);
|
|
188805
|
+
if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
|
|
188789
188806
|
}
|
|
188790
188807
|
}
|
|
188791
188808
|
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.7.0-dev.
|
|
5
|
+
"version": "5.7.0-dev.20240821",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"node": "20.1.0",
|
|
118
118
|
"npm": "8.19.4"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "7f597beb2ea8fc101c5ae1bf0a7d02aa809a685a"
|
|
121
121
|
}
|