typescript 5.0.0-dev.20221207 → 5.0.0-dev.20221208
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 +40 -48
- package/lib/tsserver.js +40 -48
- package/lib/tsserverlibrary.js +40 -48
- package/lib/typescript.js +40 -48
- package/lib/typingsInstaller.js +3 -5
- package/package.json +2 -2
package/lib/tsserverlibrary.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
45
|
+
version = `${versionMajorMinor}.0-dev.20221208`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -40965,8 +40965,9 @@ ${lanes.join("\n")}
|
|
|
40965
40965
|
const nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
40966
40966
|
const undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
40967
40967
|
const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */);
|
|
40968
|
+
const missingType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
40969
|
+
const undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType;
|
|
40968
40970
|
const optionalType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
40969
|
-
const missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768 /* Undefined */, "undefined") : undefinedType;
|
|
40970
40971
|
const nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
40971
40972
|
const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */);
|
|
40972
40973
|
const stringType = createIntrinsicType(4 /* String */, "string");
|
|
@@ -51124,7 +51125,7 @@ ${lanes.join("\n")}
|
|
|
51124
51125
|
return links.resolvedJSDocType;
|
|
51125
51126
|
}
|
|
51126
51127
|
function getSubstitutionType(baseType, constraint) {
|
|
51127
|
-
if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType
|
|
51128
|
+
if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) {
|
|
51128
51129
|
return baseType;
|
|
51129
51130
|
}
|
|
51130
51131
|
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
|
@@ -51864,10 +51865,9 @@ ${lanes.join("\n")}
|
|
|
51864
51865
|
if (includes & 3 /* AnyOrUnknown */) {
|
|
51865
51866
|
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : includes & 65536 /* Null */ || containsType(typeSet, unknownType) ? unknownType : nonNullUnknownType;
|
|
51866
51867
|
}
|
|
51867
|
-
if (
|
|
51868
|
-
|
|
51869
|
-
|
|
51870
|
-
orderedRemoveItemAt(typeSet, missingIndex);
|
|
51868
|
+
if (includes & 32768 /* Undefined */) {
|
|
51869
|
+
if (typeSet.length >= 2 && typeSet[0] === undefinedType && typeSet[1] === missingType) {
|
|
51870
|
+
orderedRemoveItemAt(typeSet, 1);
|
|
51871
51871
|
}
|
|
51872
51872
|
}
|
|
51873
51873
|
if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
@@ -51992,7 +51992,7 @@ ${lanes.join("\n")}
|
|
|
51992
51992
|
if (type === wildcardType)
|
|
51993
51993
|
includes |= 8388608 /* IncludesWildcard */;
|
|
51994
51994
|
} else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
|
|
51995
|
-
if (
|
|
51995
|
+
if (type === missingType) {
|
|
51996
51996
|
includes |= 262144 /* IncludesMissingType */;
|
|
51997
51997
|
type = undefinedType;
|
|
51998
51998
|
}
|
|
@@ -52142,9 +52142,9 @@ ${lanes.join("\n")}
|
|
|
52142
52142
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
52143
52143
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
52144
52144
|
} else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
|
|
52145
|
-
const
|
|
52145
|
+
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
52146
52146
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
52147
|
-
result = getUnionType([getIntersectionType(typeSet),
|
|
52147
|
+
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
52148
52148
|
} else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
|
|
52149
52149
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
52150
52150
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
@@ -52563,7 +52563,7 @@ ${lanes.join("\n")}
|
|
|
52563
52563
|
errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
|
|
52564
52564
|
return mapType(objectType, (t) => {
|
|
52565
52565
|
const restType = getRestTypeOfTupleType(t) || undefinedType;
|
|
52566
|
-
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType,
|
|
52566
|
+
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
|
|
52567
52567
|
});
|
|
52568
52568
|
}
|
|
52569
52569
|
}
|
|
@@ -52583,11 +52583,11 @@ ${lanes.join("\n")}
|
|
|
52583
52583
|
if (accessNode && indexInfo.keyType === stringType && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
52584
52584
|
const indexNode = getIndexNodeForAccessExpression(accessNode);
|
|
52585
52585
|
error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
|
|
52586
|
-
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type,
|
|
52586
|
+
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
|
|
52587
52587
|
}
|
|
52588
52588
|
errorIfWritingToReadonlyIndex(indexInfo);
|
|
52589
52589
|
if (accessFlags & 1 /* IncludeUndefined */ && !(objectType.symbol && objectType.symbol.flags & (256 /* RegularEnum */ | 128 /* ConstEnum */) && (indexType.symbol && indexType.flags & 1024 /* EnumLiteral */ && getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
|
|
52590
|
-
return getUnionType([indexInfo.type,
|
|
52590
|
+
return getUnionType([indexInfo.type, missingType]);
|
|
52591
52591
|
}
|
|
52592
52592
|
return indexInfo.type;
|
|
52593
52593
|
}
|
|
@@ -57048,8 +57048,8 @@ ${lanes.join("\n")}
|
|
|
57048
57048
|
}
|
|
57049
57049
|
function getOptionalType(type, isProperty = false) {
|
|
57050
57050
|
Debug.assert(strictNullChecks);
|
|
57051
|
-
const missingOrUndefined = isProperty ?
|
|
57052
|
-
return type
|
|
57051
|
+
const missingOrUndefined = isProperty ? undefinedOrMissingType : undefinedType;
|
|
57052
|
+
return type === missingOrUndefined || type.flags & 1048576 /* Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
|
|
57053
57053
|
}
|
|
57054
57054
|
function getGlobalNonNullableTypeInstantiation(type) {
|
|
57055
57055
|
if (!deferredGlobalNonNullableTypeAlias) {
|
|
@@ -57076,7 +57076,7 @@ ${lanes.join("\n")}
|
|
|
57076
57076
|
return exactOptionalPropertyTypes && isOptional ? removeType(type, missingType) : type;
|
|
57077
57077
|
}
|
|
57078
57078
|
function containsMissingType(type) {
|
|
57079
|
-
return
|
|
57079
|
+
return type === missingType || !!(type.flags & 1048576 /* Union */) && type.types[0] === missingType;
|
|
57080
57080
|
}
|
|
57081
57081
|
function removeMissingOrUndefinedType(type) {
|
|
57082
57082
|
return exactOptionalPropertyTypes ? removeType(type, missingType) : getTypeWithFacts(type, 524288 /* NEUndefined */);
|
|
@@ -57176,7 +57176,7 @@ ${lanes.join("\n")}
|
|
|
57176
57176
|
if (cached) {
|
|
57177
57177
|
return cached;
|
|
57178
57178
|
}
|
|
57179
|
-
const result = createSymbolWithType(prop,
|
|
57179
|
+
const result = createSymbolWithType(prop, undefinedOrMissingType);
|
|
57180
57180
|
result.flags |= 16777216 /* Optional */;
|
|
57181
57181
|
undefinedProperties.set(prop.escapedName, result);
|
|
57182
57182
|
return result;
|
|
@@ -58226,7 +58226,7 @@ ${lanes.join("\n")}
|
|
|
58226
58226
|
}
|
|
58227
58227
|
}
|
|
58228
58228
|
function isTypeOrBaseIdenticalTo(s, t) {
|
|
58229
|
-
return
|
|
58229
|
+
return t === missingType ? s === t : isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */);
|
|
58230
58230
|
}
|
|
58231
58231
|
function isTypeCloselyMatchedBy(s, t) {
|
|
58232
58232
|
return !!(s.flags & 524288 /* Object */ && t.flags & 524288 /* Object */ && s.symbol && s.symbol === t.symbol || s.aliasSymbol && s.aliasTypeArguments && s.aliasSymbol === t.aliasSymbol);
|
|
@@ -58755,7 +58755,7 @@ ${lanes.join("\n")}
|
|
|
58755
58755
|
function includeUndefinedInIndexSignature(type) {
|
|
58756
58756
|
if (!type)
|
|
58757
58757
|
return type;
|
|
58758
|
-
return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type,
|
|
58758
|
+
return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
|
|
58759
58759
|
}
|
|
58760
58760
|
function getTypeOfDestructuredSpreadExpression(type) {
|
|
58761
58761
|
return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, void 0) || errorType);
|
|
@@ -59520,7 +59520,7 @@ ${lanes.join("\n")}
|
|
|
59520
59520
|
if (bypassFlow) {
|
|
59521
59521
|
const flowType = getTypeAtFlowNode(bypassFlow);
|
|
59522
59522
|
const type = getTypeFromFlowType(flowType);
|
|
59523
|
-
if (!contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {
|
|
59523
|
+
if (!(type.flags & 131072 /* Never */) && !contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {
|
|
59524
59524
|
if (type === declaredType && declaredType === initialType) {
|
|
59525
59525
|
return type;
|
|
59526
59526
|
}
|
|
@@ -61659,7 +61659,7 @@ ${lanes.join("\n")}
|
|
|
61659
61659
|
}
|
|
61660
61660
|
} else if (exactOptionalPropertyTypes && e.kind === 229 /* OmittedExpression */) {
|
|
61661
61661
|
hasOmittedExpression = true;
|
|
61662
|
-
elementTypes.push(
|
|
61662
|
+
elementTypes.push(undefinedOrMissingType);
|
|
61663
61663
|
elementFlags.push(2 /* Optional */);
|
|
61664
61664
|
} else {
|
|
61665
61665
|
const elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length);
|
|
@@ -62806,7 +62806,7 @@ ${lanes.join("\n")}
|
|
|
62806
62806
|
if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) {
|
|
62807
62807
|
error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
|
|
62808
62808
|
}
|
|
62809
|
-
propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type,
|
|
62809
|
+
propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
|
|
62810
62810
|
if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
|
|
62811
62811
|
error(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText));
|
|
62812
62812
|
}
|
|
@@ -65008,6 +65008,7 @@ ${lanes.join("\n")}
|
|
|
65008
65008
|
}
|
|
65009
65009
|
function checkExpressionWithTypeArguments(node) {
|
|
65010
65010
|
checkGrammarExpressionWithTypeArguments(node);
|
|
65011
|
+
forEach(node.typeArguments, checkSourceElement);
|
|
65011
65012
|
const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
|
|
65012
65013
|
const typeArguments = node.typeArguments;
|
|
65013
65014
|
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
|
|
@@ -100793,6 +100794,7 @@ ${lanes.join("\n")}
|
|
|
100793
100794
|
getSymlinkCache,
|
|
100794
100795
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
100795
100796
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
100797
|
+
getCanonicalFileName,
|
|
100796
100798
|
getFileIncludeReasons: () => fileReasons,
|
|
100797
100799
|
structureIsReused,
|
|
100798
100800
|
writeFile: writeFile2
|
|
@@ -103509,14 +103511,13 @@ ${lanes.join("\n")}
|
|
|
103509
103511
|
const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
|
|
103510
103512
|
const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
|
|
103511
103513
|
const useOldState = canReuseOldState(referencedMap, oldState);
|
|
103512
|
-
const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
|
|
103513
103514
|
newProgram.getTypeChecker();
|
|
103514
103515
|
for (const sourceFile of newProgram.getSourceFiles()) {
|
|
103515
103516
|
const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
|
|
103516
103517
|
const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0;
|
|
103517
103518
|
const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0;
|
|
103518
103519
|
if (referencedMap) {
|
|
103519
|
-
const newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
|
|
103520
|
+
const newReferences = getReferencedFiles(newProgram, sourceFile, newProgram.getCanonicalFileName);
|
|
103520
103521
|
if (newReferences) {
|
|
103521
103522
|
referencedMap.set(sourceFile.resolvedPath, newReferences);
|
|
103522
103523
|
}
|
|
@@ -103906,7 +103907,6 @@ ${lanes.join("\n")}
|
|
|
103906
103907
|
if (!diagnostics.length)
|
|
103907
103908
|
return emptyArray;
|
|
103908
103909
|
let buildInfoDirectory;
|
|
103909
|
-
let getCanonicalFileName;
|
|
103910
103910
|
return diagnostics.map((diagnostic) => {
|
|
103911
103911
|
const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
|
|
103912
103912
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
@@ -103919,7 +103919,7 @@ ${lanes.join("\n")}
|
|
|
103919
103919
|
});
|
|
103920
103920
|
function toPath3(path) {
|
|
103921
103921
|
buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
|
|
103922
|
-
return toPath(path, buildInfoDirectory,
|
|
103922
|
+
return toPath(path, buildInfoDirectory, newProgram.getCanonicalFileName);
|
|
103923
103923
|
}
|
|
103924
103924
|
}
|
|
103925
103925
|
function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
|
|
@@ -104217,7 +104217,6 @@ ${lanes.join("\n")}
|
|
|
104217
104217
|
function getBuildInfo2(state, bundle) {
|
|
104218
104218
|
var _a2, _b, _c;
|
|
104219
104219
|
const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
|
|
104220
|
-
const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
|
|
104221
104220
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
104222
104221
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
104223
104222
|
const fileNames = [];
|
|
@@ -104335,7 +104334,7 @@ ${lanes.join("\n")}
|
|
|
104335
104334
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
104336
104335
|
}
|
|
104337
104336
|
function relativeToBuildInfo(path) {
|
|
104338
|
-
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));
|
|
104337
|
+
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName));
|
|
104339
104338
|
}
|
|
104340
104339
|
function toFileId(path) {
|
|
104341
104340
|
let fileId = fileNameToFileId.get(path);
|
|
@@ -104438,7 +104437,6 @@ ${lanes.join("\n")}
|
|
|
104438
104437
|
}
|
|
104439
104438
|
function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
|
|
104440
104439
|
var _a2, _b;
|
|
104441
|
-
let getCanonicalFileName;
|
|
104442
104440
|
text = getTextHandlingSourceMapForSignature(text, data);
|
|
104443
104441
|
let sourceFileDirectory;
|
|
104444
104442
|
if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
|
|
@@ -104458,7 +104456,7 @@ ${lanes.join("\n")}
|
|
|
104458
104456
|
return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
|
|
104459
104457
|
sourceFileDirectory,
|
|
104460
104458
|
diagnostic.file.resolvedPath,
|
|
104461
|
-
|
|
104459
|
+
program.getCanonicalFileName
|
|
104462
104460
|
))}(${diagnostic.start},${diagnostic.length})`;
|
|
104463
104461
|
}
|
|
104464
104462
|
}
|
|
@@ -105892,8 +105890,7 @@ ${lanes.join("\n")}
|
|
|
105892
105890
|
function explainFiles(program, write) {
|
|
105893
105891
|
var _a2, _b;
|
|
105894
105892
|
const reasons = program.getFileIncludeReasons();
|
|
105895
|
-
const
|
|
105896
|
-
const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName);
|
|
105893
|
+
const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName);
|
|
105897
105894
|
for (const file of program.getSourceFiles()) {
|
|
105898
105895
|
write(`${toFileName(file, relativeFileName)}`);
|
|
105899
105896
|
(_a2 = reasons.get(file.path)) == null ? void 0 : _a2.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
|
|
@@ -105951,10 +105948,9 @@ ${lanes.join("\n")}
|
|
|
105951
105948
|
const configFile = program.getCompilerOptions().configFile;
|
|
105952
105949
|
if (!((_a2 = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a2.validatedFilesSpec))
|
|
105953
105950
|
return void 0;
|
|
105954
|
-
const
|
|
105955
|
-
const filePath = getCanonicalFileName(fileName);
|
|
105951
|
+
const filePath = program.getCanonicalFileName(fileName);
|
|
105956
105952
|
const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
105957
|
-
return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
|
|
105953
|
+
return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
|
|
105958
105954
|
}
|
|
105959
105955
|
function getMatchedIncludeSpec(program, fileName) {
|
|
105960
105956
|
var _a2, _b;
|
|
@@ -107161,8 +107157,6 @@ ${lanes.join("\n")}
|
|
|
107161
107157
|
function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {
|
|
107162
107158
|
const host = hostOrHostWithWatch;
|
|
107163
107159
|
const hostWithWatch = hostOrHostWithWatch;
|
|
107164
|
-
const currentDirectory = host.getCurrentDirectory();
|
|
107165
|
-
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
107166
107160
|
const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
107167
107161
|
const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions);
|
|
107168
107162
|
setGetSourceFileAsHashVersioned(compilerHost);
|
|
@@ -107174,7 +107168,7 @@ ${lanes.join("\n")}
|
|
|
107174
107168
|
compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache);
|
|
107175
107169
|
let moduleResolutionCache, typeReferenceDirectiveResolutionCache;
|
|
107176
107170
|
if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) {
|
|
107177
|
-
moduleResolutionCache = createModuleResolutionCache(
|
|
107171
|
+
moduleResolutionCache = createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName);
|
|
107178
107172
|
compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
107179
107173
|
moduleNames,
|
|
107180
107174
|
containingFile,
|
|
@@ -107188,7 +107182,7 @@ ${lanes.join("\n")}
|
|
|
107188
107182
|
compilerHost.getModuleResolutionCache = () => moduleResolutionCache;
|
|
107189
107183
|
}
|
|
107190
107184
|
if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) {
|
|
107191
|
-
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(
|
|
107185
|
+
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
107192
107186
|
compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
107193
107187
|
typeDirectiveNames,
|
|
107194
107188
|
containingFile,
|
|
@@ -107205,8 +107199,6 @@ ${lanes.join("\n")}
|
|
|
107205
107199
|
const state = {
|
|
107206
107200
|
host,
|
|
107207
107201
|
hostWithWatch,
|
|
107208
|
-
currentDirectory,
|
|
107209
|
-
getCanonicalFileName,
|
|
107210
107202
|
parseConfigFileHost: parseConfigHostFromCompilerHostLike(host),
|
|
107211
107203
|
write: maybeBind(host, host.trace),
|
|
107212
107204
|
options,
|
|
@@ -107250,7 +107242,7 @@ ${lanes.join("\n")}
|
|
|
107250
107242
|
return state;
|
|
107251
107243
|
}
|
|
107252
107244
|
function toPath2(state, fileName) {
|
|
107253
|
-
return toPath(fileName, state.
|
|
107245
|
+
return toPath(fileName, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
107254
107246
|
}
|
|
107255
107247
|
function toResolvedConfigFilePath(state, fileName) {
|
|
107256
107248
|
const { resolvedConfigFilePaths } = state;
|
|
@@ -107293,7 +107285,7 @@ ${lanes.join("\n")}
|
|
|
107293
107285
|
return parsed;
|
|
107294
107286
|
}
|
|
107295
107287
|
function resolveProjectName(state, name) {
|
|
107296
|
-
return resolveConfigFileProjectName(resolvePath(state.
|
|
107288
|
+
return resolveConfigFileProjectName(resolvePath(state.compilerHost.getCurrentDirectory(), name));
|
|
107297
107289
|
}
|
|
107298
107290
|
function createBuildOrder(state, roots) {
|
|
107299
107291
|
const temporaryMarks = /* @__PURE__ */ new Map();
|
|
@@ -107496,7 +107488,7 @@ ${lanes.join("\n")}
|
|
|
107496
107488
|
projectPath,
|
|
107497
107489
|
buildOrder,
|
|
107498
107490
|
getCompilerOptions: () => config.options,
|
|
107499
|
-
getCurrentDirectory: () => state.
|
|
107491
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
107500
107492
|
updateOutputFileStatmps: () => {
|
|
107501
107493
|
updateOutputTimestamps(state, config, projectPath);
|
|
107502
107494
|
updateOutputFileStampsPending = false;
|
|
@@ -107521,7 +107513,7 @@ ${lanes.join("\n")}
|
|
|
107521
107513
|
projectPath,
|
|
107522
107514
|
buildOrder,
|
|
107523
107515
|
getCompilerOptions: () => config.options,
|
|
107524
|
-
getCurrentDirectory: () => state.
|
|
107516
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
107525
107517
|
getBuilderProgram: () => withProgramOrUndefined(identity),
|
|
107526
107518
|
getProgram: () => withProgramOrUndefined(
|
|
107527
107519
|
(program2) => program2.getProgramOrUndefined()
|
|
@@ -107577,7 +107569,7 @@ ${lanes.join("\n")}
|
|
|
107577
107569
|
projectPath,
|
|
107578
107570
|
buildOrder,
|
|
107579
107571
|
getCompilerOptions: () => config.options,
|
|
107580
|
-
getCurrentDirectory: () => state.
|
|
107572
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
107581
107573
|
emit: (writeFile2, customTransformers) => {
|
|
107582
107574
|
if (step !== 4 /* EmitBundle */)
|
|
107583
107575
|
return invalidatedProjectOfBundle;
|
|
@@ -108684,7 +108676,7 @@ ${lanes.join("\n")}
|
|
|
108684
108676
|
fileOrDirectory,
|
|
108685
108677
|
fileOrDirectoryPath: toPath2(state, fileOrDirectory),
|
|
108686
108678
|
configFileName: resolved,
|
|
108687
|
-
currentDirectory: state.
|
|
108679
|
+
currentDirectory: state.compilerHost.getCurrentDirectory(),
|
|
108688
108680
|
options: parsed.options,
|
|
108689
108681
|
program: state.builderPrograms.get(resolvedPath) || ((_a2 = getCachedParsedConfigFile(state, resolvedPath)) == null ? void 0 : _a2.fileNames),
|
|
108690
108682
|
useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames,
|
|
@@ -108789,7 +108781,7 @@ ${lanes.join("\n")}
|
|
|
108789
108781
|
};
|
|
108790
108782
|
}
|
|
108791
108783
|
function relName(state, path) {
|
|
108792
|
-
return convertToRelativePath(path, state.
|
|
108784
|
+
return convertToRelativePath(path, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
108793
108785
|
}
|
|
108794
108786
|
function reportStatus(state, message, ...args) {
|
|
108795
108787
|
state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args));
|