typescript 5.0.0-dev.20221207 → 5.0.0-dev.20221209
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/lib.es2021.intl.d.ts +15 -0
- package/lib/tsc.js +42 -50
- package/lib/tsserver.js +63 -56
- package/lib/tsserverlibrary.d.ts +3 -1
- package/lib/tsserverlibrary.js +63 -56
- package/lib/typescript.d.ts +2 -1
- package/lib/typescript.js +50 -52
- package/lib/typingsInstaller.js +4 -6
- package/package.json +3 -2
package/lib/lib.es2021.intl.d.ts
CHANGED
|
@@ -85,6 +85,12 @@ declare namespace Intl {
|
|
|
85
85
|
style?: ListFormatStyle | undefined;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
interface ResolvedListFormatOptions {
|
|
89
|
+
locale: string;
|
|
90
|
+
style: ListFormatStyle;
|
|
91
|
+
type: ListFormatType;
|
|
92
|
+
}
|
|
93
|
+
|
|
88
94
|
interface ListFormat {
|
|
89
95
|
/**
|
|
90
96
|
* Returns a string with a language-specific representation of the list.
|
|
@@ -111,6 +117,15 @@ declare namespace Intl {
|
|
|
111
117
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts).
|
|
112
118
|
*/
|
|
113
119
|
formatToParts(list: Iterable<string>): { type: "element" | "literal", value: string; }[];
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Returns a new object with properties reflecting the locale and style
|
|
123
|
+
* formatting options computed during the construction of the current
|
|
124
|
+
* `Intl.ListFormat` object.
|
|
125
|
+
*
|
|
126
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions).
|
|
127
|
+
*/
|
|
128
|
+
resolvedOptions(): ResolvedListFormatOptions;
|
|
114
129
|
}
|
|
115
130
|
|
|
116
131
|
const ListFormat: {
|
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
26
|
+
var version = `${versionMajorMinor}.0-dev.20221209`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -14662,7 +14662,7 @@ function getSetExternalModuleIndicator(options) {
|
|
|
14662
14662
|
}
|
|
14663
14663
|
}
|
|
14664
14664
|
function getEmitScriptTarget(compilerOptions) {
|
|
14665
|
-
return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ ||
|
|
14665
|
+
return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
|
|
14666
14666
|
}
|
|
14667
14667
|
function getEmitModuleKind(compilerOptions) {
|
|
14668
14668
|
return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
@@ -38645,8 +38645,9 @@ function createTypeChecker(host) {
|
|
|
38645
38645
|
const nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
38646
38646
|
const undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
38647
38647
|
const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */);
|
|
38648
|
+
const missingType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
38649
|
+
const undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType;
|
|
38648
38650
|
const optionalType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
38649
|
-
const missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768 /* Undefined */, "undefined") : undefinedType;
|
|
38650
38651
|
const nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
38651
38652
|
const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */);
|
|
38652
38653
|
const stringType = createIntrinsicType(4 /* String */, "string");
|
|
@@ -48804,7 +48805,7 @@ function createTypeChecker(host) {
|
|
|
48804
48805
|
return links.resolvedJSDocType;
|
|
48805
48806
|
}
|
|
48806
48807
|
function getSubstitutionType(baseType, constraint) {
|
|
48807
|
-
if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType
|
|
48808
|
+
if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) {
|
|
48808
48809
|
return baseType;
|
|
48809
48810
|
}
|
|
48810
48811
|
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
|
@@ -49544,10 +49545,9 @@ function createTypeChecker(host) {
|
|
|
49544
49545
|
if (includes & 3 /* AnyOrUnknown */) {
|
|
49545
49546
|
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : includes & 65536 /* Null */ || containsType(typeSet, unknownType) ? unknownType : nonNullUnknownType;
|
|
49546
49547
|
}
|
|
49547
|
-
if (
|
|
49548
|
-
|
|
49549
|
-
|
|
49550
|
-
orderedRemoveItemAt(typeSet, missingIndex);
|
|
49548
|
+
if (includes & 32768 /* Undefined */) {
|
|
49549
|
+
if (typeSet.length >= 2 && typeSet[0] === undefinedType && typeSet[1] === missingType) {
|
|
49550
|
+
orderedRemoveItemAt(typeSet, 1);
|
|
49551
49551
|
}
|
|
49552
49552
|
}
|
|
49553
49553
|
if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
@@ -49672,7 +49672,7 @@ function createTypeChecker(host) {
|
|
|
49672
49672
|
if (type === wildcardType)
|
|
49673
49673
|
includes |= 8388608 /* IncludesWildcard */;
|
|
49674
49674
|
} else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
|
|
49675
|
-
if (
|
|
49675
|
+
if (type === missingType) {
|
|
49676
49676
|
includes |= 262144 /* IncludesMissingType */;
|
|
49677
49677
|
type = undefinedType;
|
|
49678
49678
|
}
|
|
@@ -49822,9 +49822,9 @@ function createTypeChecker(host) {
|
|
|
49822
49822
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
49823
49823
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
49824
49824
|
} else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
|
|
49825
|
-
const
|
|
49825
|
+
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
49826
49826
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
49827
|
-
result = getUnionType([getIntersectionType(typeSet),
|
|
49827
|
+
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
49828
49828
|
} else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
|
|
49829
49829
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
49830
49830
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
@@ -50243,7 +50243,7 @@ function createTypeChecker(host) {
|
|
|
50243
50243
|
errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
|
|
50244
50244
|
return mapType(objectType, (t) => {
|
|
50245
50245
|
const restType = getRestTypeOfTupleType(t) || undefinedType;
|
|
50246
|
-
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType,
|
|
50246
|
+
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
|
|
50247
50247
|
});
|
|
50248
50248
|
}
|
|
50249
50249
|
}
|
|
@@ -50263,11 +50263,11 @@ function createTypeChecker(host) {
|
|
|
50263
50263
|
if (accessNode && indexInfo.keyType === stringType && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
50264
50264
|
const indexNode = getIndexNodeForAccessExpression(accessNode);
|
|
50265
50265
|
error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
|
|
50266
|
-
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type,
|
|
50266
|
+
return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
|
|
50267
50267
|
}
|
|
50268
50268
|
errorIfWritingToReadonlyIndex(indexInfo);
|
|
50269
50269
|
if (accessFlags & 1 /* IncludeUndefined */ && !(objectType.symbol && objectType.symbol.flags & (256 /* RegularEnum */ | 128 /* ConstEnum */) && (indexType.symbol && indexType.flags & 1024 /* EnumLiteral */ && getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
|
|
50270
|
-
return getUnionType([indexInfo.type,
|
|
50270
|
+
return getUnionType([indexInfo.type, missingType]);
|
|
50271
50271
|
}
|
|
50272
50272
|
return indexInfo.type;
|
|
50273
50273
|
}
|
|
@@ -54728,8 +54728,8 @@ function createTypeChecker(host) {
|
|
|
54728
54728
|
}
|
|
54729
54729
|
function getOptionalType(type, isProperty = false) {
|
|
54730
54730
|
Debug.assert(strictNullChecks);
|
|
54731
|
-
const missingOrUndefined = isProperty ?
|
|
54732
|
-
return type
|
|
54731
|
+
const missingOrUndefined = isProperty ? undefinedOrMissingType : undefinedType;
|
|
54732
|
+
return type === missingOrUndefined || type.flags & 1048576 /* Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
|
|
54733
54733
|
}
|
|
54734
54734
|
function getGlobalNonNullableTypeInstantiation(type) {
|
|
54735
54735
|
if (!deferredGlobalNonNullableTypeAlias) {
|
|
@@ -54756,7 +54756,7 @@ function createTypeChecker(host) {
|
|
|
54756
54756
|
return exactOptionalPropertyTypes && isOptional ? removeType(type, missingType) : type;
|
|
54757
54757
|
}
|
|
54758
54758
|
function containsMissingType(type) {
|
|
54759
|
-
return
|
|
54759
|
+
return type === missingType || !!(type.flags & 1048576 /* Union */) && type.types[0] === missingType;
|
|
54760
54760
|
}
|
|
54761
54761
|
function removeMissingOrUndefinedType(type) {
|
|
54762
54762
|
return exactOptionalPropertyTypes ? removeType(type, missingType) : getTypeWithFacts(type, 524288 /* NEUndefined */);
|
|
@@ -54856,7 +54856,7 @@ function createTypeChecker(host) {
|
|
|
54856
54856
|
if (cached) {
|
|
54857
54857
|
return cached;
|
|
54858
54858
|
}
|
|
54859
|
-
const result = createSymbolWithType(prop,
|
|
54859
|
+
const result = createSymbolWithType(prop, undefinedOrMissingType);
|
|
54860
54860
|
result.flags |= 16777216 /* Optional */;
|
|
54861
54861
|
undefinedProperties.set(prop.escapedName, result);
|
|
54862
54862
|
return result;
|
|
@@ -55906,7 +55906,7 @@ function createTypeChecker(host) {
|
|
|
55906
55906
|
}
|
|
55907
55907
|
}
|
|
55908
55908
|
function isTypeOrBaseIdenticalTo(s, t) {
|
|
55909
|
-
return
|
|
55909
|
+
return t === missingType ? s === t : isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */);
|
|
55910
55910
|
}
|
|
55911
55911
|
function isTypeCloselyMatchedBy(s, t) {
|
|
55912
55912
|
return !!(s.flags & 524288 /* Object */ && t.flags & 524288 /* Object */ && s.symbol && s.symbol === t.symbol || s.aliasSymbol && s.aliasTypeArguments && s.aliasSymbol === t.aliasSymbol);
|
|
@@ -56435,7 +56435,7 @@ function createTypeChecker(host) {
|
|
|
56435
56435
|
function includeUndefinedInIndexSignature(type) {
|
|
56436
56436
|
if (!type)
|
|
56437
56437
|
return type;
|
|
56438
|
-
return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type,
|
|
56438
|
+
return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
|
|
56439
56439
|
}
|
|
56440
56440
|
function getTypeOfDestructuredSpreadExpression(type) {
|
|
56441
56441
|
return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, void 0) || errorType);
|
|
@@ -57200,7 +57200,7 @@ function createTypeChecker(host) {
|
|
|
57200
57200
|
if (bypassFlow) {
|
|
57201
57201
|
const flowType = getTypeAtFlowNode(bypassFlow);
|
|
57202
57202
|
const type = getTypeFromFlowType(flowType);
|
|
57203
|
-
if (!contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {
|
|
57203
|
+
if (!(type.flags & 131072 /* Never */) && !contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {
|
|
57204
57204
|
if (type === declaredType && declaredType === initialType) {
|
|
57205
57205
|
return type;
|
|
57206
57206
|
}
|
|
@@ -59339,7 +59339,7 @@ function createTypeChecker(host) {
|
|
|
59339
59339
|
}
|
|
59340
59340
|
} else if (exactOptionalPropertyTypes && e.kind === 229 /* OmittedExpression */) {
|
|
59341
59341
|
hasOmittedExpression = true;
|
|
59342
|
-
elementTypes.push(
|
|
59342
|
+
elementTypes.push(undefinedOrMissingType);
|
|
59343
59343
|
elementFlags.push(2 /* Optional */);
|
|
59344
59344
|
} else {
|
|
59345
59345
|
const elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length);
|
|
@@ -60486,7 +60486,7 @@ function createTypeChecker(host) {
|
|
|
60486
60486
|
if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) {
|
|
60487
60487
|
error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
|
|
60488
60488
|
}
|
|
60489
|
-
propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type,
|
|
60489
|
+
propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
|
|
60490
60490
|
if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
|
|
60491
60491
|
error(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText));
|
|
60492
60492
|
}
|
|
@@ -62688,6 +62688,7 @@ function createTypeChecker(host) {
|
|
|
62688
62688
|
}
|
|
62689
62689
|
function checkExpressionWithTypeArguments(node) {
|
|
62690
62690
|
checkGrammarExpressionWithTypeArguments(node);
|
|
62691
|
+
forEach(node.typeArguments, checkSourceElement);
|
|
62691
62692
|
const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
|
|
62692
62693
|
const typeArguments = node.typeArguments;
|
|
62693
62694
|
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
|
|
@@ -98044,6 +98045,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
98044
98045
|
getSymlinkCache,
|
|
98045
98046
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
98046
98047
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
98048
|
+
getCanonicalFileName,
|
|
98047
98049
|
getFileIncludeReasons: () => fileReasons,
|
|
98048
98050
|
structureIsReused,
|
|
98049
98051
|
writeFile: writeFile2
|
|
@@ -98668,7 +98670,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
98668
98670
|
}
|
|
98669
98671
|
function getDiagnosticsHelper(sourceFile, getDiagnostics, cancellationToken) {
|
|
98670
98672
|
if (sourceFile) {
|
|
98671
|
-
return getDiagnostics(sourceFile, cancellationToken);
|
|
98673
|
+
return sortAndDeduplicateDiagnostics(getDiagnostics(sourceFile, cancellationToken));
|
|
98672
98674
|
}
|
|
98673
98675
|
return sortAndDeduplicateDiagnostics(flatMap(program.getSourceFiles(), (sourceFile2) => {
|
|
98674
98676
|
if (cancellationToken) {
|
|
@@ -100612,14 +100614,13 @@ var BuilderState;
|
|
|
100612
100614
|
const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
|
|
100613
100615
|
const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
|
|
100614
100616
|
const useOldState = canReuseOldState(referencedMap, oldState);
|
|
100615
|
-
const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
|
|
100616
100617
|
newProgram.getTypeChecker();
|
|
100617
100618
|
for (const sourceFile of newProgram.getSourceFiles()) {
|
|
100618
100619
|
const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
|
|
100619
100620
|
const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0;
|
|
100620
100621
|
const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0;
|
|
100621
100622
|
if (referencedMap) {
|
|
100622
|
-
const newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
|
|
100623
|
+
const newReferences = getReferencedFiles(newProgram, sourceFile, newProgram.getCanonicalFileName);
|
|
100623
100624
|
if (newReferences) {
|
|
100624
100625
|
referencedMap.set(sourceFile.resolvedPath, newReferences);
|
|
100625
100626
|
}
|
|
@@ -101007,7 +101008,6 @@ function convertToDiagnostics(diagnostics, newProgram) {
|
|
|
101007
101008
|
if (!diagnostics.length)
|
|
101008
101009
|
return emptyArray;
|
|
101009
101010
|
let buildInfoDirectory;
|
|
101010
|
-
let getCanonicalFileName;
|
|
101011
101011
|
return diagnostics.map((diagnostic) => {
|
|
101012
101012
|
const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
|
|
101013
101013
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
@@ -101020,7 +101020,7 @@ function convertToDiagnostics(diagnostics, newProgram) {
|
|
|
101020
101020
|
});
|
|
101021
101021
|
function toPath3(path) {
|
|
101022
101022
|
buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
|
|
101023
|
-
return toPath(path, buildInfoDirectory,
|
|
101023
|
+
return toPath(path, buildInfoDirectory, newProgram.getCanonicalFileName);
|
|
101024
101024
|
}
|
|
101025
101025
|
}
|
|
101026
101026
|
function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
|
|
@@ -101318,7 +101318,6 @@ function isProgramBundleEmitBuildInfo(info) {
|
|
|
101318
101318
|
function getBuildInfo2(state, bundle) {
|
|
101319
101319
|
var _a2, _b, _c;
|
|
101320
101320
|
const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
|
|
101321
|
-
const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
|
|
101322
101321
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
101323
101322
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
101324
101323
|
const fileNames = [];
|
|
@@ -101436,7 +101435,7 @@ function getBuildInfo2(state, bundle) {
|
|
|
101436
101435
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
101437
101436
|
}
|
|
101438
101437
|
function relativeToBuildInfo(path) {
|
|
101439
|
-
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));
|
|
101438
|
+
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName));
|
|
101440
101439
|
}
|
|
101441
101440
|
function toFileId(path) {
|
|
101442
101441
|
let fileId = fileNameToFileId.get(path);
|
|
@@ -101539,7 +101538,6 @@ function getTextHandlingSourceMapForSignature(text, data) {
|
|
|
101539
101538
|
}
|
|
101540
101539
|
function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
|
|
101541
101540
|
var _a2, _b;
|
|
101542
|
-
let getCanonicalFileName;
|
|
101543
101541
|
text = getTextHandlingSourceMapForSignature(text, data);
|
|
101544
101542
|
let sourceFileDirectory;
|
|
101545
101543
|
if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
|
|
@@ -101559,7 +101557,7 @@ function computeSignatureWithDiagnostics(program, sourceFile, text, host, data)
|
|
|
101559
101557
|
return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
|
|
101560
101558
|
sourceFileDirectory,
|
|
101561
101559
|
diagnostic.file.resolvedPath,
|
|
101562
|
-
|
|
101560
|
+
program.getCanonicalFileName
|
|
101563
101561
|
))}(${diagnostic.start},${diagnostic.length})`;
|
|
101564
101562
|
}
|
|
101565
101563
|
}
|
|
@@ -102957,8 +102955,7 @@ function listFiles(program, write) {
|
|
|
102957
102955
|
function explainFiles(program, write) {
|
|
102958
102956
|
var _a2, _b;
|
|
102959
102957
|
const reasons = program.getFileIncludeReasons();
|
|
102960
|
-
const
|
|
102961
|
-
const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName);
|
|
102958
|
+
const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName);
|
|
102962
102959
|
for (const file of program.getSourceFiles()) {
|
|
102963
102960
|
write(`${toFileName(file, relativeFileName)}`);
|
|
102964
102961
|
(_a2 = reasons.get(file.path)) == null ? void 0 : _a2.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
|
|
@@ -103016,10 +103013,9 @@ function getMatchedFileSpec(program, fileName) {
|
|
|
103016
103013
|
const configFile = program.getCompilerOptions().configFile;
|
|
103017
103014
|
if (!((_a2 = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a2.validatedFilesSpec))
|
|
103018
103015
|
return void 0;
|
|
103019
|
-
const
|
|
103020
|
-
const filePath = getCanonicalFileName(fileName);
|
|
103016
|
+
const filePath = program.getCanonicalFileName(fileName);
|
|
103021
103017
|
const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
103022
|
-
return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
|
|
103018
|
+
return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
|
|
103023
103019
|
}
|
|
103024
103020
|
function getMatchedIncludeSpec(program, fileName) {
|
|
103025
103021
|
var _a2, _b;
|
|
@@ -104153,8 +104149,6 @@ function createSolutionBuilderWithWatch(host, rootNames, defaultOptions, baseWat
|
|
|
104153
104149
|
function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {
|
|
104154
104150
|
const host = hostOrHostWithWatch;
|
|
104155
104151
|
const hostWithWatch = hostOrHostWithWatch;
|
|
104156
|
-
const currentDirectory = host.getCurrentDirectory();
|
|
104157
|
-
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
104158
104152
|
const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
104159
104153
|
const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions);
|
|
104160
104154
|
setGetSourceFileAsHashVersioned(compilerHost);
|
|
@@ -104166,7 +104160,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104166
104160
|
compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache);
|
|
104167
104161
|
let moduleResolutionCache, typeReferenceDirectiveResolutionCache;
|
|
104168
104162
|
if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) {
|
|
104169
|
-
moduleResolutionCache = createModuleResolutionCache(
|
|
104163
|
+
moduleResolutionCache = createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName);
|
|
104170
104164
|
compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
104171
104165
|
moduleNames,
|
|
104172
104166
|
containingFile,
|
|
@@ -104180,7 +104174,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104180
104174
|
compilerHost.getModuleResolutionCache = () => moduleResolutionCache;
|
|
104181
104175
|
}
|
|
104182
104176
|
if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) {
|
|
104183
|
-
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(
|
|
104177
|
+
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
104184
104178
|
compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
104185
104179
|
typeDirectiveNames,
|
|
104186
104180
|
containingFile,
|
|
@@ -104197,8 +104191,6 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104197
104191
|
const state = {
|
|
104198
104192
|
host,
|
|
104199
104193
|
hostWithWatch,
|
|
104200
|
-
currentDirectory,
|
|
104201
|
-
getCanonicalFileName,
|
|
104202
104194
|
parseConfigFileHost: parseConfigHostFromCompilerHostLike(host),
|
|
104203
104195
|
write: maybeBind(host, host.trace),
|
|
104204
104196
|
options,
|
|
@@ -104242,7 +104234,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104242
104234
|
return state;
|
|
104243
104235
|
}
|
|
104244
104236
|
function toPath2(state, fileName) {
|
|
104245
|
-
return toPath(fileName, state.
|
|
104237
|
+
return toPath(fileName, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
104246
104238
|
}
|
|
104247
104239
|
function toResolvedConfigFilePath(state, fileName) {
|
|
104248
104240
|
const { resolvedConfigFilePaths } = state;
|
|
@@ -104285,7 +104277,7 @@ function parseConfigFile(state, configFileName, configFilePath) {
|
|
|
104285
104277
|
return parsed;
|
|
104286
104278
|
}
|
|
104287
104279
|
function resolveProjectName(state, name) {
|
|
104288
|
-
return resolveConfigFileProjectName(resolvePath(state.
|
|
104280
|
+
return resolveConfigFileProjectName(resolvePath(state.compilerHost.getCurrentDirectory(), name));
|
|
104289
104281
|
}
|
|
104290
104282
|
function createBuildOrder(state, roots) {
|
|
104291
104283
|
const temporaryMarks = /* @__PURE__ */ new Map();
|
|
@@ -104488,7 +104480,7 @@ function createUpdateOutputFileStampsProject(state, project, projectPath, config
|
|
|
104488
104480
|
projectPath,
|
|
104489
104481
|
buildOrder,
|
|
104490
104482
|
getCompilerOptions: () => config.options,
|
|
104491
|
-
getCurrentDirectory: () => state.
|
|
104483
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104492
104484
|
updateOutputFileStatmps: () => {
|
|
104493
104485
|
updateOutputTimestamps(state, config, projectPath);
|
|
104494
104486
|
updateOutputFileStampsPending = false;
|
|
@@ -104513,7 +104505,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
|
|
|
104513
104505
|
projectPath,
|
|
104514
104506
|
buildOrder,
|
|
104515
104507
|
getCompilerOptions: () => config.options,
|
|
104516
|
-
getCurrentDirectory: () => state.
|
|
104508
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104517
104509
|
getBuilderProgram: () => withProgramOrUndefined(identity),
|
|
104518
104510
|
getProgram: () => withProgramOrUndefined(
|
|
104519
104511
|
(program2) => program2.getProgramOrUndefined()
|
|
@@ -104569,7 +104561,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
|
|
|
104569
104561
|
projectPath,
|
|
104570
104562
|
buildOrder,
|
|
104571
104563
|
getCompilerOptions: () => config.options,
|
|
104572
|
-
getCurrentDirectory: () => state.
|
|
104564
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104573
104565
|
emit: (writeFile2, customTransformers) => {
|
|
104574
104566
|
if (step !== 4 /* EmitBundle */)
|
|
104575
104567
|
return invalidatedProjectOfBundle;
|
|
@@ -105676,7 +105668,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
|
|
|
105676
105668
|
fileOrDirectory,
|
|
105677
105669
|
fileOrDirectoryPath: toPath2(state, fileOrDirectory),
|
|
105678
105670
|
configFileName: resolved,
|
|
105679
|
-
currentDirectory: state.
|
|
105671
|
+
currentDirectory: state.compilerHost.getCurrentDirectory(),
|
|
105680
105672
|
options: parsed.options,
|
|
105681
105673
|
program: state.builderPrograms.get(resolvedPath) || ((_a2 = getCachedParsedConfigFile(state, resolvedPath)) == null ? void 0 : _a2.fileNames),
|
|
105682
105674
|
useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames,
|
|
@@ -105781,7 +105773,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
|
|
|
105781
105773
|
};
|
|
105782
105774
|
}
|
|
105783
105775
|
function relName(state, path) {
|
|
105784
|
-
return convertToRelativePath(path, state.
|
|
105776
|
+
return convertToRelativePath(path, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
105785
105777
|
}
|
|
105786
105778
|
function reportStatus(state, message, ...args) {
|
|
105787
105779
|
state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args));
|