@typescript-deploys/pr-build 5.2.0-pr-54507-7 → 5.2.0-pr-54546-4
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 +113 -30
- package/lib/tsserver.js +141 -33
- package/lib/tsserverlibrary.js +138 -33
- package/lib/typescript.js +135 -33
- package/lib/typingsInstaller.js +7 -5
- package/package.json +2 -2
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230605`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7452,6 +7452,7 @@ ${lanes.join("\n")}
|
|
|
7452
7452
|
The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
|
|
7453
7453
|
Add_extends_constraint: diag(2211, 3 /* Message */, "Add_extends_constraint_2211", "Add `extends` constraint."),
|
|
7454
7454
|
Add_extends_constraint_to_all_type_parameters: diag(2212, 3 /* Message */, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"),
|
|
7455
|
+
The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2213, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supp_2213", "The project root is ambiguous, but is required to determine the module format of output '.js' files. Supply the `rootDir` compiler option to disambiguate."),
|
|
7455
7456
|
Duplicate_identifier_0: diag(2300, 1 /* Error */, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
|
|
7456
7457
|
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, 1 /* Error */, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
7457
7458
|
Static_members_cannot_reference_class_type_parameters: diag(2302, 1 /* Error */, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
|
|
@@ -45382,9 +45383,9 @@ ${lanes.join("\n")}
|
|
|
45382
45383
|
candidatesOutArray,
|
|
45383
45384
|
/*argumentCount*/
|
|
45384
45385
|
void 0,
|
|
45385
|
-
|
|
45386
|
+
64 /* IsForStringLiteralArgumentCompletions */
|
|
45386
45387
|
)),
|
|
45387
|
-
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount,
|
|
45388
|
+
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 32 /* IsForSignatureHelp */)),
|
|
45388
45389
|
getExpandedParameters,
|
|
45389
45390
|
hasEffectiveRestParameter,
|
|
45390
45391
|
containsArgumentsReference,
|
|
@@ -53339,7 +53340,7 @@ ${lanes.join("\n")}
|
|
|
53339
53340
|
return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
|
|
53340
53341
|
}
|
|
53341
53342
|
function getTypeForBindingElement(declaration) {
|
|
53342
|
-
const checkMode = declaration.dotDotDotToken ?
|
|
53343
|
+
const checkMode = declaration.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */;
|
|
53343
53344
|
const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
53344
53345
|
return parentType && getBindingElementTypeFromParentType(declaration, parentType);
|
|
53345
53346
|
}
|
|
@@ -68239,7 +68240,7 @@ ${lanes.join("\n")}
|
|
|
68239
68240
|
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
|
|
68240
68241
|
}
|
|
68241
68242
|
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
68242
|
-
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode &
|
|
68243
|
+
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 128 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2(
|
|
68243
68244
|
node,
|
|
68244
68245
|
/*contextFlags*/
|
|
68245
68246
|
void 0
|
|
@@ -68996,7 +68997,7 @@ ${lanes.join("\n")}
|
|
|
68996
68997
|
function getContextualTypeForBindingElement(declaration, contextFlags) {
|
|
68997
68998
|
const parent2 = declaration.parent.parent;
|
|
68998
68999
|
const name = declaration.propertyName || declaration.name;
|
|
68999
|
-
const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 207 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ?
|
|
69000
|
+
const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 207 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */);
|
|
69000
69001
|
if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
|
|
69001
69002
|
return void 0;
|
|
69002
69003
|
if (parent2.name.kind === 206 /* ArrayBindingPattern */) {
|
|
@@ -70045,7 +70046,9 @@ ${lanes.join("\n")}
|
|
|
70045
70046
|
elementTypes.push(undefinedOrMissingType);
|
|
70046
70047
|
elementFlags.push(2 /* Optional */);
|
|
70047
70048
|
} else {
|
|
70048
|
-
const
|
|
70049
|
+
const shouldAddAsIntraExpressionInferenceSite = inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && isContextSensitive(e);
|
|
70050
|
+
const elementCheckMode = (checkMode || 0 /* Normal */) | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
70051
|
+
const type = checkExpressionForMutableLocation(e, elementCheckMode, forceTuple);
|
|
70049
70052
|
elementTypes.push(addOptionality(
|
|
70050
70053
|
type,
|
|
70051
70054
|
/*isProperty*/
|
|
@@ -70053,7 +70056,7 @@ ${lanes.join("\n")}
|
|
|
70053
70056
|
hasOmittedExpression
|
|
70054
70057
|
));
|
|
70055
70058
|
elementFlags.push(hasOmittedExpression ? 2 /* Optional */ : 1 /* Required */);
|
|
70056
|
-
if (
|
|
70059
|
+
if (shouldAddAsIntraExpressionInferenceSite) {
|
|
70057
70060
|
const inferenceContext = getInferenceContext(node);
|
|
70058
70061
|
Debug.assert(inferenceContext);
|
|
70059
70062
|
addIntraExpressionInferenceSite(inferenceContext, e, type);
|
|
@@ -70194,11 +70197,13 @@ ${lanes.join("\n")}
|
|
|
70194
70197
|
let member = getSymbolOfDeclaration(memberDecl);
|
|
70195
70198
|
const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
|
|
70196
70199
|
if (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 303 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
|
|
70197
|
-
|
|
70200
|
+
const shouldAddAsIntraExpressionInferenceSite = contextualType && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 173 /* MethodDeclaration */) && isContextSensitive(memberDecl);
|
|
70201
|
+
const propCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
70202
|
+
let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, propCheckMode) : (
|
|
70198
70203
|
// avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring
|
|
70199
70204
|
// for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.
|
|
70200
70205
|
// we don't want to say "could not find 'a'".
|
|
70201
|
-
memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name,
|
|
70206
|
+
memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, propCheckMode) : checkObjectLiteralMethod(memberDecl, propCheckMode)
|
|
70202
70207
|
);
|
|
70203
70208
|
if (isInJavascript) {
|
|
70204
70209
|
const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
|
|
@@ -70242,7 +70247,7 @@ ${lanes.join("\n")}
|
|
|
70242
70247
|
prop.links.target = member;
|
|
70243
70248
|
member = prop;
|
|
70244
70249
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
70245
|
-
if (
|
|
70250
|
+
if (shouldAddAsIntraExpressionInferenceSite) {
|
|
70246
70251
|
const inferenceContext = getInferenceContext(node);
|
|
70247
70252
|
Debug.assert(inferenceContext);
|
|
70248
70253
|
const inferenceNode = memberDecl.kind === 302 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
|
|
@@ -70415,7 +70420,9 @@ ${lanes.join("\n")}
|
|
|
70415
70420
|
for (const attributeDecl of attributes.properties) {
|
|
70416
70421
|
const member = attributeDecl.symbol;
|
|
70417
70422
|
if (isJsxAttribute(attributeDecl)) {
|
|
70418
|
-
const
|
|
70423
|
+
const shouldAddAsIntraExpressionInferenceSite = contextualType && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && isContextSensitive(attributeDecl);
|
|
70424
|
+
const attributeCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
70425
|
+
const exprType = checkJsxAttribute(attributeDecl, attributeCheckMode);
|
|
70419
70426
|
objectFlags |= getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
|
|
70420
70427
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
70421
70428
|
attributeSymbol.declarations = member.declarations;
|
|
@@ -70436,7 +70443,7 @@ ${lanes.join("\n")}
|
|
|
70436
70443
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
70437
70444
|
}
|
|
70438
70445
|
}
|
|
70439
|
-
if (
|
|
70446
|
+
if (shouldAddAsIntraExpressionInferenceSite) {
|
|
70440
70447
|
const inferenceContext = getInferenceContext(attributes);
|
|
70441
70448
|
Debug.assert(inferenceContext);
|
|
70442
70449
|
const inferenceNode = attributeDecl.initializer.expression;
|
|
@@ -72054,7 +72061,7 @@ ${lanes.join("\n")}
|
|
|
72054
72061
|
}
|
|
72055
72062
|
for (let i = 0; i < argCount; i++) {
|
|
72056
72063
|
const arg = args[i];
|
|
72057
|
-
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode &
|
|
72064
|
+
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 64 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
72058
72065
|
const paramType = getTypeAtPosition(signature, i);
|
|
72059
72066
|
if (couldContainTypeVariables(paramType)) {
|
|
72060
72067
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -72667,12 +72674,12 @@ ${lanes.join("\n")}
|
|
|
72667
72674
|
const args = getEffectiveCallArguments(node);
|
|
72668
72675
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
72669
72676
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
72670
|
-
argCheckMode |= checkMode &
|
|
72677
|
+
argCheckMode |= checkMode & 64 /* IsForStringLiteralArgumentCompletions */;
|
|
72671
72678
|
let candidatesForArgumentError;
|
|
72672
72679
|
let candidateForArgumentArityError;
|
|
72673
72680
|
let candidateForTypeArgumentError;
|
|
72674
72681
|
let result;
|
|
72675
|
-
const signatureHelpTrailingComma = !!(checkMode &
|
|
72682
|
+
const signatureHelpTrailingComma = !!(checkMode & 32 /* IsForSignatureHelp */) && node.kind === 212 /* CallExpression */ && node.arguments.hasTrailingComma;
|
|
72676
72683
|
if (candidates.length > 1) {
|
|
72677
72684
|
result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
|
|
72678
72685
|
}
|
|
@@ -72891,7 +72898,7 @@ ${lanes.join("\n")}
|
|
|
72891
72898
|
continue;
|
|
72892
72899
|
}
|
|
72893
72900
|
if (argCheckMode) {
|
|
72894
|
-
argCheckMode = checkMode &
|
|
72901
|
+
argCheckMode = checkMode & 64 /* IsForStringLiteralArgumentCompletions */;
|
|
72895
72902
|
if (inferenceContext) {
|
|
72896
72903
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
72897
72904
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -75969,7 +75976,7 @@ ${lanes.join("\n")}
|
|
|
75969
75976
|
case 36 /* ExclamationEqualsToken */:
|
|
75970
75977
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
75971
75978
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
75972
|
-
if (!(checkMode && checkMode &
|
|
75979
|
+
if (!(checkMode && checkMode & 256 /* TypeOnly */)) {
|
|
75973
75980
|
if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
|
|
75974
75981
|
const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
|
|
75975
75982
|
error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
|
|
@@ -76628,7 +76635,7 @@ ${lanes.join("\n")}
|
|
|
76628
76635
|
}
|
|
76629
76636
|
}
|
|
76630
76637
|
const startInvocationCount = flowInvocationCount;
|
|
76631
|
-
const type = checkExpression(node,
|
|
76638
|
+
const type = checkExpression(node, 256 /* TypeOnly */);
|
|
76632
76639
|
if (flowInvocationCount !== startInvocationCount) {
|
|
76633
76640
|
const cache = flowTypeCache || (flowTypeCache = []);
|
|
76634
76641
|
cache[getNodeId(node)] = type;
|
|
@@ -79099,7 +79106,7 @@ ${lanes.join("\n")}
|
|
|
79099
79106
|
checkComputedPropertyName(node.propertyName);
|
|
79100
79107
|
}
|
|
79101
79108
|
const parent2 = node.parent.parent;
|
|
79102
|
-
const parentCheckMode = node.dotDotDotToken ?
|
|
79109
|
+
const parentCheckMode = node.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */;
|
|
79103
79110
|
const parentType = getTypeForBindingElementParent(parent2, parentCheckMode);
|
|
79104
79111
|
const name = node.propertyName || node.name;
|
|
79105
79112
|
if (parentType && !isBindingPattern(name)) {
|
|
@@ -85835,10 +85842,11 @@ ${lanes.join("\n")}
|
|
|
85835
85842
|
CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential";
|
|
85836
85843
|
CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive";
|
|
85837
85844
|
CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
|
|
85838
|
-
CheckMode3[CheckMode3["
|
|
85839
|
-
CheckMode3[CheckMode3["
|
|
85840
|
-
CheckMode3[CheckMode3["
|
|
85841
|
-
CheckMode3[CheckMode3["
|
|
85845
|
+
CheckMode3[CheckMode3["SkipAddingIntraExpressionSites"] = 16] = "SkipAddingIntraExpressionSites";
|
|
85846
|
+
CheckMode3[CheckMode3["IsForSignatureHelp"] = 32] = "IsForSignatureHelp";
|
|
85847
|
+
CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 64] = "IsForStringLiteralArgumentCompletions";
|
|
85848
|
+
CheckMode3[CheckMode3["RestBindingElement"] = 128] = "RestBindingElement";
|
|
85849
|
+
CheckMode3[CheckMode3["TypeOnly"] = 256] = "TypeOnly";
|
|
85842
85850
|
return CheckMode3;
|
|
85843
85851
|
})(CheckMode || {});
|
|
85844
85852
|
SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
@@ -110079,6 +110087,15 @@ ${lanes.join("\n")}
|
|
|
110079
110087
|
getDeclarationEmitExtensionForPath(inputFileName)
|
|
110080
110088
|
);
|
|
110081
110089
|
}
|
|
110090
|
+
function getOutputDeclarationFileNameWithoutConfigFile(inputFileName, options, ignoreCase, currentDirectory, getCommonSourceDirectory2) {
|
|
110091
|
+
const directory = options.declarationDir || options.outDir ? getNormalizedAbsolutePath(options.declarationDir || options.outDir, currentDirectory) : void 0;
|
|
110092
|
+
const outputPathWithoutChangedExtension = directory ? resolvePath(directory, getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase)) : inputFileName;
|
|
110093
|
+
const outputFileName = changeExtension(
|
|
110094
|
+
outputPathWithoutChangedExtension,
|
|
110095
|
+
getDeclarationEmitExtensionForPath(inputFileName)
|
|
110096
|
+
);
|
|
110097
|
+
return outputFileName;
|
|
110098
|
+
}
|
|
110082
110099
|
function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2) {
|
|
110083
110100
|
if (configFile.options.emitDeclarationOnly)
|
|
110084
110101
|
return void 0;
|
|
@@ -110089,6 +110106,18 @@ ${lanes.join("\n")}
|
|
|
110089
110106
|
);
|
|
110090
110107
|
return !isJsonFile || comparePaths(inputFileName, outputFileName, Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 /* EqualTo */ ? outputFileName : void 0;
|
|
110091
110108
|
}
|
|
110109
|
+
function getOutputJSFileNameWithoutConfigFile(inputFileName, options, ignoreCase, currentDirectory, getCommonSourceDirectory2) {
|
|
110110
|
+
if (options.emitDeclarationOnly)
|
|
110111
|
+
return void 0;
|
|
110112
|
+
const isJsonFile = fileExtensionIs(inputFileName, ".json" /* Json */);
|
|
110113
|
+
const outDir = options.outDir ? getNormalizedAbsolutePath(options.outDir, currentDirectory) : void 0;
|
|
110114
|
+
const outputPathWithoutChangedExtension = outDir ? resolvePath(outDir, getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase)) : inputFileName;
|
|
110115
|
+
const outputFileName = changeExtension(
|
|
110116
|
+
outputPathWithoutChangedExtension,
|
|
110117
|
+
getOutputExtension(inputFileName, options)
|
|
110118
|
+
);
|
|
110119
|
+
return !isJsonFile || !options.configFilePath || comparePaths(inputFileName, outputFileName, options.configFilePath, ignoreCase) !== 0 /* EqualTo */ ? outputFileName : void 0;
|
|
110120
|
+
}
|
|
110092
110121
|
function createAddOutput() {
|
|
110093
110122
|
let outputs;
|
|
110094
110123
|
return { addOutput, getOutputs };
|
|
@@ -116619,6 +116648,15 @@ ${lanes.join("\n")}
|
|
|
116619
116648
|
return { impliedNodeFormat, packageJsonLocations, packageJsonScope };
|
|
116620
116649
|
}
|
|
116621
116650
|
}
|
|
116651
|
+
function moduleFormatNeedsPackageJsonLookup(fileName, options) {
|
|
116652
|
+
switch (getEmitModuleResolutionKind(options)) {
|
|
116653
|
+
case 3 /* Node16 */:
|
|
116654
|
+
case 99 /* NodeNext */:
|
|
116655
|
+
return fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]);
|
|
116656
|
+
default:
|
|
116657
|
+
return false;
|
|
116658
|
+
}
|
|
116659
|
+
}
|
|
116622
116660
|
function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
116623
116661
|
if (!program)
|
|
116624
116662
|
return false;
|
|
@@ -116645,6 +116683,7 @@ ${lanes.join("\n")}
|
|
|
116645
116683
|
let files;
|
|
116646
116684
|
let symlinks;
|
|
116647
116685
|
let commonSourceDirectory;
|
|
116686
|
+
let assumedCommonSourceDirectory;
|
|
116648
116687
|
let typeChecker;
|
|
116649
116688
|
let classifiableNames;
|
|
116650
116689
|
const ambientModuleNameToUnmodifiedFileName = /* @__PURE__ */ new Map();
|
|
@@ -117136,6 +117175,9 @@ ${lanes.join("\n")}
|
|
|
117136
117175
|
}
|
|
117137
117176
|
return commonSourceDirectory;
|
|
117138
117177
|
}
|
|
117178
|
+
function getAssumedCommonSourceDirectory() {
|
|
117179
|
+
return commonSourceDirectory ?? (assumedCommonSourceDirectory ?? (assumedCommonSourceDirectory = getCommonSourceDirectory(options, () => rootNames, host.getCurrentDirectory(), getCanonicalFileName)));
|
|
117180
|
+
}
|
|
117139
117181
|
function getClassifiableNames() {
|
|
117140
117182
|
var _a2;
|
|
117141
117183
|
if (!classifiableNames) {
|
|
@@ -117359,7 +117401,7 @@ ${lanes.join("\n")}
|
|
|
117359
117401
|
})(SeenPackageName || (SeenPackageName = {}));
|
|
117360
117402
|
const seenPackageNames = /* @__PURE__ */ new Map();
|
|
117361
117403
|
for (const oldSourceFile of oldSourceFiles) {
|
|
117362
|
-
const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName
|
|
117404
|
+
const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName);
|
|
117363
117405
|
let newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(
|
|
117364
117406
|
oldSourceFile.fileName,
|
|
117365
117407
|
oldSourceFile.resolvedPath,
|
|
@@ -118321,10 +118363,48 @@ ${lanes.join("\n")}
|
|
|
118321
118363
|
(_b2 = tracing) == null ? void 0 : _b2.pop();
|
|
118322
118364
|
return result;
|
|
118323
118365
|
}
|
|
118324
|
-
function
|
|
118325
|
-
|
|
118326
|
-
|
|
118327
|
-
|
|
118366
|
+
function getImpliedNodeFormatForFile2(fileName) {
|
|
118367
|
+
let fileNameForModuleFormatDetection = getNormalizedAbsolutePath(fileName, currentDirectory);
|
|
118368
|
+
if (moduleFormatNeedsPackageJsonLookup(fileName, options)) {
|
|
118369
|
+
const projectReference = getResolvedProjectReferenceToRedirect(fileName);
|
|
118370
|
+
if (projectReference) {
|
|
118371
|
+
Debug.assert(useSourceOfProjectReferenceRedirect);
|
|
118372
|
+
fileNameForModuleFormatDetection = getOutputDeclarationFileName(
|
|
118373
|
+
fileNameForModuleFormatDetection,
|
|
118374
|
+
projectReference.commandLine,
|
|
118375
|
+
!host.useCaseSensitiveFileNames()
|
|
118376
|
+
) || getOutputJSFileName(
|
|
118377
|
+
fileNameForModuleFormatDetection,
|
|
118378
|
+
projectReference.commandLine,
|
|
118379
|
+
!host.useCaseSensitiveFileNames()
|
|
118380
|
+
) || fileNameForModuleFormatDetection;
|
|
118381
|
+
} else {
|
|
118382
|
+
fileNameForModuleFormatDetection = getOutputDeclarationFileNameWithoutConfigFile(
|
|
118383
|
+
fileNameForModuleFormatDetection,
|
|
118384
|
+
options,
|
|
118385
|
+
!host.useCaseSensitiveFileNames(),
|
|
118386
|
+
currentDirectory,
|
|
118387
|
+
getAssumedCommonSourceDirectory
|
|
118388
|
+
) || getOutputJSFileNameWithoutConfigFile(
|
|
118389
|
+
fileNameForModuleFormatDetection,
|
|
118390
|
+
options,
|
|
118391
|
+
!host.useCaseSensitiveFileNames(),
|
|
118392
|
+
currentDirectory,
|
|
118393
|
+
getAssumedCommonSourceDirectory
|
|
118394
|
+
) || fileNameForModuleFormatDetection;
|
|
118395
|
+
}
|
|
118396
|
+
}
|
|
118397
|
+
return getImpliedNodeFormatForFileWorker(
|
|
118398
|
+
fileNameForModuleFormatDetection,
|
|
118399
|
+
moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(),
|
|
118400
|
+
host,
|
|
118401
|
+
options
|
|
118402
|
+
);
|
|
118403
|
+
}
|
|
118404
|
+
function getCreateSourceFileOptions(fileName) {
|
|
118405
|
+
const result = getImpliedNodeFormatForFile2(fileName);
|
|
118406
|
+
const languageVersion = getEmitScriptTarget(options);
|
|
118407
|
+
const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options);
|
|
118328
118408
|
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
|
|
118329
118409
|
}
|
|
118330
118410
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
@@ -118396,7 +118476,7 @@ ${lanes.join("\n")}
|
|
|
118396
118476
|
redirectedPath = toPath3(redirect);
|
|
118397
118477
|
}
|
|
118398
118478
|
}
|
|
118399
|
-
const sourceFileOptions = getCreateSourceFileOptions(fileName
|
|
118479
|
+
const sourceFileOptions = getCreateSourceFileOptions(fileName);
|
|
118400
118480
|
const file = host.getSourceFile(
|
|
118401
118481
|
fileName,
|
|
118402
118482
|
sourceFileOptions,
|
|
@@ -119019,6 +119099,9 @@ ${lanes.join("\n")}
|
|
|
119019
119099
|
createDiagnosticForOptionName(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir");
|
|
119020
119100
|
}
|
|
119021
119101
|
}
|
|
119102
|
+
if (assumedCommonSourceDirectory && assumedCommonSourceDirectory !== getCommonSourceDirectory2()) {
|
|
119103
|
+
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supply_the_rootDir_compiler_option_to_disambiguate));
|
|
119104
|
+
}
|
|
119022
119105
|
if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) {
|
|
119023
119106
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields");
|
|
119024
119107
|
}
|
|
@@ -162095,13 +162178,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162095
162178
|
if (!signature || !candidates.length) {
|
|
162096
162179
|
return;
|
|
162097
162180
|
}
|
|
162098
|
-
|
|
162099
|
-
|
|
162181
|
+
let signatureParamPos = 0;
|
|
162182
|
+
for (const originalArg of args) {
|
|
162100
162183
|
const arg = skipParentheses(originalArg);
|
|
162101
162184
|
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
|
|
162102
162185
|
continue;
|
|
162103
162186
|
}
|
|
162104
|
-
|
|
162187
|
+
let spreadArgs = 0;
|
|
162188
|
+
if (isSpreadElement(arg)) {
|
|
162189
|
+
const spreadType = checker.getTypeAtLocation(arg.expression);
|
|
162190
|
+
if (checker.isTupleType(spreadType)) {
|
|
162191
|
+
const { elementFlags, fixedLength } = spreadType.target;
|
|
162192
|
+
if (fixedLength === 0) {
|
|
162193
|
+
continue;
|
|
162194
|
+
}
|
|
162195
|
+
const firstOptionalIndex = findIndex(elementFlags, (f) => !(f & 1 /* Required */));
|
|
162196
|
+
const requiredArgs = firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex;
|
|
162197
|
+
if (requiredArgs > 0) {
|
|
162198
|
+
spreadArgs = firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex;
|
|
162199
|
+
}
|
|
162200
|
+
}
|
|
162201
|
+
}
|
|
162202
|
+
const identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, signatureParamPos);
|
|
162203
|
+
signatureParamPos = signatureParamPos + (spreadArgs || 1);
|
|
162105
162204
|
if (identifierNameInfo) {
|
|
162106
162205
|
const [parameterName, isFirstVariadicArgument] = identifierNameInfo;
|
|
162107
162206
|
const isParameterNameNotSameAsArgument = preferences.includeInlayParameterNameHintsWhenArgumentMatchesName || !identifierOrAccessExpressionPostfixMatchesParameterName(arg, parameterName);
|
|
@@ -181907,8 +182006,11 @@ ${e.message}`;
|
|
|
181907
182006
|
getOriginalNodeId: () => getOriginalNodeId,
|
|
181908
182007
|
getOriginalSourceFile: () => getOriginalSourceFile,
|
|
181909
182008
|
getOutputDeclarationFileName: () => getOutputDeclarationFileName,
|
|
182009
|
+
getOutputDeclarationFileNameWithoutConfigFile: () => getOutputDeclarationFileNameWithoutConfigFile,
|
|
181910
182010
|
getOutputExtension: () => getOutputExtension,
|
|
181911
182011
|
getOutputFileNames: () => getOutputFileNames,
|
|
182012
|
+
getOutputJSFileName: () => getOutputJSFileName,
|
|
182013
|
+
getOutputJSFileNameWithoutConfigFile: () => getOutputJSFileNameWithoutConfigFile,
|
|
181912
182014
|
getOutputPathsFor: () => getOutputPathsFor,
|
|
181913
182015
|
getOutputPathsForBundle: () => getOutputPathsForBundle,
|
|
181914
182016
|
getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath,
|
|
@@ -184286,8 +184388,11 @@ ${e.message}`;
|
|
|
184286
184388
|
getOriginalNodeId: () => getOriginalNodeId,
|
|
184287
184389
|
getOriginalSourceFile: () => getOriginalSourceFile,
|
|
184288
184390
|
getOutputDeclarationFileName: () => getOutputDeclarationFileName,
|
|
184391
|
+
getOutputDeclarationFileNameWithoutConfigFile: () => getOutputDeclarationFileNameWithoutConfigFile,
|
|
184289
184392
|
getOutputExtension: () => getOutputExtension,
|
|
184290
184393
|
getOutputFileNames: () => getOutputFileNames,
|
|
184394
|
+
getOutputJSFileName: () => getOutputJSFileName,
|
|
184395
|
+
getOutputJSFileNameWithoutConfigFile: () => getOutputJSFileNameWithoutConfigFile,
|
|
184291
184396
|
getOutputPathsFor: () => getOutputPathsFor,
|
|
184292
184397
|
getOutputPathsForBundle: () => getOutputPathsForBundle,
|
|
184293
184398
|
getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath,
|