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/tsserver.js CHANGED
@@ -2645,7 +2645,7 @@ __export(ts_server_exports3, {
2645
2645
 
2646
2646
  // src/compiler/corePublic.ts
2647
2647
  var versionMajorMinor = "5.0";
2648
- var version = `${versionMajorMinor}.0-dev.20221207`;
2648
+ var version = `${versionMajorMinor}.0-dev.20221208`;
2649
2649
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2650
2650
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2651
2651
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -43504,8 +43504,9 @@ function createTypeChecker(host) {
43504
43504
  const nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown");
43505
43505
  const undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
43506
43506
  const undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */);
43507
+ const missingType = createIntrinsicType(32768 /* Undefined */, "undefined");
43508
+ const undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType;
43507
43509
  const optionalType = createIntrinsicType(32768 /* Undefined */, "undefined");
43508
- const missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768 /* Undefined */, "undefined") : undefinedType;
43509
43510
  const nullType = createIntrinsicType(65536 /* Null */, "null");
43510
43511
  const nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */);
43511
43512
  const stringType = createIntrinsicType(4 /* String */, "string");
@@ -53663,7 +53664,7 @@ function createTypeChecker(host) {
53663
53664
  return links.resolvedJSDocType;
53664
53665
  }
53665
53666
  function getSubstitutionType(baseType, constraint) {
53666
- if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || !isGenericType(baseType) && !isGenericType(constraint)) {
53667
+ if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) {
53667
53668
  return baseType;
53668
53669
  }
53669
53670
  const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
@@ -54403,10 +54404,9 @@ function createTypeChecker(host) {
54403
54404
  if (includes & 3 /* AnyOrUnknown */) {
54404
54405
  return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : includes & 65536 /* Null */ || containsType(typeSet, unknownType) ? unknownType : nonNullUnknownType;
54405
54406
  }
54406
- if (exactOptionalPropertyTypes && includes & 32768 /* Undefined */) {
54407
- const missingIndex = binarySearch(typeSet, missingType, getTypeId, compareValues);
54408
- if (missingIndex >= 0 && containsType(typeSet, undefinedType)) {
54409
- orderedRemoveItemAt(typeSet, missingIndex);
54407
+ if (includes & 32768 /* Undefined */) {
54408
+ if (typeSet.length >= 2 && typeSet[0] === undefinedType && typeSet[1] === missingType) {
54409
+ orderedRemoveItemAt(typeSet, 1);
54410
54410
  }
54411
54411
  }
54412
54412
  if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
@@ -54531,7 +54531,7 @@ function createTypeChecker(host) {
54531
54531
  if (type === wildcardType)
54532
54532
  includes |= 8388608 /* IncludesWildcard */;
54533
54533
  } else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
54534
- if (exactOptionalPropertyTypes && type === missingType) {
54534
+ if (type === missingType) {
54535
54535
  includes |= 262144 /* IncludesMissingType */;
54536
54536
  type = undefinedType;
54537
54537
  }
@@ -54681,9 +54681,9 @@ function createTypeChecker(host) {
54681
54681
  if (intersectUnionsOfPrimitiveTypes(typeSet)) {
54682
54682
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
54683
54683
  } else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
54684
- const undefinedOrMissingType = exactOptionalPropertyTypes && some(typeSet, (t) => containsType(t.types, missingType)) ? missingType : undefinedType;
54684
+ const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
54685
54685
  removeFromEach(typeSet, 32768 /* Undefined */);
54686
- result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
54686
+ result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
54687
54687
  } else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
54688
54688
  removeFromEach(typeSet, 65536 /* Null */);
54689
54689
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
@@ -55102,7 +55102,7 @@ function createTypeChecker(host) {
55102
55102
  errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType));
55103
55103
  return mapType(objectType, (t) => {
55104
55104
  const restType = getRestTypeOfTupleType(t) || undefinedType;
55105
- return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, undefinedType]) : restType;
55105
+ return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType;
55106
55106
  });
55107
55107
  }
55108
55108
  }
@@ -55122,11 +55122,11 @@ function createTypeChecker(host) {
55122
55122
  if (accessNode && indexInfo.keyType === stringType && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
55123
55123
  const indexNode = getIndexNodeForAccessExpression(accessNode);
55124
55124
  error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
55125
- return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
55125
+ return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
55126
55126
  }
55127
55127
  errorIfWritingToReadonlyIndex(indexInfo);
55128
55128
  if (accessFlags & 1 /* IncludeUndefined */ && !(objectType.symbol && objectType.symbol.flags & (256 /* RegularEnum */ | 128 /* ConstEnum */) && (indexType.symbol && indexType.flags & 1024 /* EnumLiteral */ && getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
55129
- return getUnionType([indexInfo.type, undefinedType]);
55129
+ return getUnionType([indexInfo.type, missingType]);
55130
55130
  }
55131
55131
  return indexInfo.type;
55132
55132
  }
@@ -59587,8 +59587,8 @@ function createTypeChecker(host) {
59587
59587
  }
59588
59588
  function getOptionalType(type, isProperty = false) {
59589
59589
  Debug.assert(strictNullChecks);
59590
- const missingOrUndefined = isProperty ? missingType : undefinedType;
59591
- return type.flags & 32768 /* Undefined */ || type.flags & 1048576 /* Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
59590
+ const missingOrUndefined = isProperty ? undefinedOrMissingType : undefinedType;
59591
+ return type === missingOrUndefined || type.flags & 1048576 /* Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
59592
59592
  }
59593
59593
  function getGlobalNonNullableTypeInstantiation(type) {
59594
59594
  if (!deferredGlobalNonNullableTypeAlias) {
@@ -59615,7 +59615,7 @@ function createTypeChecker(host) {
59615
59615
  return exactOptionalPropertyTypes && isOptional ? removeType(type, missingType) : type;
59616
59616
  }
59617
59617
  function containsMissingType(type) {
59618
- return exactOptionalPropertyTypes && (type === missingType || type.flags & 1048576 /* Union */ && containsType(type.types, missingType));
59618
+ return type === missingType || !!(type.flags & 1048576 /* Union */) && type.types[0] === missingType;
59619
59619
  }
59620
59620
  function removeMissingOrUndefinedType(type) {
59621
59621
  return exactOptionalPropertyTypes ? removeType(type, missingType) : getTypeWithFacts(type, 524288 /* NEUndefined */);
@@ -59715,7 +59715,7 @@ function createTypeChecker(host) {
59715
59715
  if (cached) {
59716
59716
  return cached;
59717
59717
  }
59718
- const result = createSymbolWithType(prop, missingType);
59718
+ const result = createSymbolWithType(prop, undefinedOrMissingType);
59719
59719
  result.flags |= 16777216 /* Optional */;
59720
59720
  undefinedProperties.set(prop.escapedName, result);
59721
59721
  return result;
@@ -60765,7 +60765,7 @@ function createTypeChecker(host) {
60765
60765
  }
60766
60766
  }
60767
60767
  function isTypeOrBaseIdenticalTo(s, t) {
60768
- return exactOptionalPropertyTypes && t === missingType ? s === t : isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */);
60768
+ return t === missingType ? s === t : isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */);
60769
60769
  }
60770
60770
  function isTypeCloselyMatchedBy(s, t) {
60771
60771
  return !!(s.flags & 524288 /* Object */ && t.flags & 524288 /* Object */ && s.symbol && s.symbol === t.symbol || s.aliasSymbol && s.aliasTypeArguments && s.aliasSymbol === t.aliasSymbol);
@@ -61294,7 +61294,7 @@ function createTypeChecker(host) {
61294
61294
  function includeUndefinedInIndexSignature(type) {
61295
61295
  if (!type)
61296
61296
  return type;
61297
- return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, undefinedType]) : type;
61297
+ return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type, missingType]) : type;
61298
61298
  }
61299
61299
  function getTypeOfDestructuredSpreadExpression(type) {
61300
61300
  return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, void 0) || errorType);
@@ -62059,7 +62059,7 @@ function createTypeChecker(host) {
62059
62059
  if (bypassFlow) {
62060
62060
  const flowType = getTypeAtFlowNode(bypassFlow);
62061
62061
  const type = getTypeFromFlowType(flowType);
62062
- if (!contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {
62062
+ if (!(type.flags & 131072 /* Never */) && !contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {
62063
62063
  if (type === declaredType && declaredType === initialType) {
62064
62064
  return type;
62065
62065
  }
@@ -64198,7 +64198,7 @@ function createTypeChecker(host) {
64198
64198
  }
64199
64199
  } else if (exactOptionalPropertyTypes && e.kind === 229 /* OmittedExpression */) {
64200
64200
  hasOmittedExpression = true;
64201
- elementTypes.push(missingType);
64201
+ elementTypes.push(undefinedOrMissingType);
64202
64202
  elementFlags.push(2 /* Optional */);
64203
64203
  } else {
64204
64204
  const elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length);
@@ -65345,7 +65345,7 @@ function createTypeChecker(host) {
65345
65345
  if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) {
65346
65346
  error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
65347
65347
  }
65348
- propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
65348
+ propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
65349
65349
  if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
65350
65350
  error(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText));
65351
65351
  }
@@ -67547,6 +67547,7 @@ function createTypeChecker(host) {
67547
67547
  }
67548
67548
  function checkExpressionWithTypeArguments(node) {
67549
67549
  checkGrammarExpressionWithTypeArguments(node);
67550
+ forEach(node.typeArguments, checkSourceElement);
67550
67551
  const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
67551
67552
  const typeArguments = node.typeArguments;
67552
67553
  if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
@@ -103129,6 +103130,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
103129
103130
  getSymlinkCache,
103130
103131
  realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
103131
103132
  useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
103133
+ getCanonicalFileName,
103132
103134
  getFileIncludeReasons: () => fileReasons,
103133
103135
  structureIsReused,
103134
103136
  writeFile: writeFile2
@@ -105705,14 +105707,13 @@ var BuilderState;
105705
105707
  const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
105706
105708
  const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
105707
105709
  const useOldState = canReuseOldState(referencedMap, oldState);
105708
- const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
105709
105710
  newProgram.getTypeChecker();
105710
105711
  for (const sourceFile of newProgram.getSourceFiles()) {
105711
105712
  const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
105712
105713
  const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0;
105713
105714
  const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0;
105714
105715
  if (referencedMap) {
105715
- const newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
105716
+ const newReferences = getReferencedFiles(newProgram, sourceFile, newProgram.getCanonicalFileName);
105716
105717
  if (newReferences) {
105717
105718
  referencedMap.set(sourceFile.resolvedPath, newReferences);
105718
105719
  }
@@ -106112,7 +106113,6 @@ function convertToDiagnostics(diagnostics, newProgram) {
106112
106113
  if (!diagnostics.length)
106113
106114
  return emptyArray;
106114
106115
  let buildInfoDirectory;
106115
- let getCanonicalFileName;
106116
106116
  return diagnostics.map((diagnostic) => {
106117
106117
  const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
106118
106118
  result.reportsUnnecessary = diagnostic.reportsUnnecessary;
@@ -106125,7 +106125,7 @@ function convertToDiagnostics(diagnostics, newProgram) {
106125
106125
  });
106126
106126
  function toPath3(path) {
106127
106127
  buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
106128
- return toPath(path, buildInfoDirectory, getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames()));
106128
+ return toPath(path, buildInfoDirectory, newProgram.getCanonicalFileName);
106129
106129
  }
106130
106130
  }
106131
106131
  function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
@@ -106423,7 +106423,6 @@ function isProgramBundleEmitBuildInfo(info) {
106423
106423
  function getBuildInfo2(state, bundle) {
106424
106424
  var _a2, _b, _c;
106425
106425
  const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
106426
- const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
106427
106426
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
106428
106427
  const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
106429
106428
  const fileNames = [];
@@ -106541,7 +106540,7 @@ function getBuildInfo2(state, bundle) {
106541
106540
  return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
106542
106541
  }
106543
106542
  function relativeToBuildInfo(path) {
106544
- return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));
106543
+ return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName));
106545
106544
  }
106546
106545
  function toFileId(path) {
106547
106546
  let fileId = fileNameToFileId.get(path);
@@ -106649,7 +106648,6 @@ function getTextHandlingSourceMapForSignature(text, data) {
106649
106648
  }
106650
106649
  function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
106651
106650
  var _a2, _b;
106652
- let getCanonicalFileName;
106653
106651
  text = getTextHandlingSourceMapForSignature(text, data);
106654
106652
  let sourceFileDirectory;
106655
106653
  if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
@@ -106669,7 +106667,7 @@ function computeSignatureWithDiagnostics(program, sourceFile, text, host, data)
106669
106667
  return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
106670
106668
  sourceFileDirectory,
106671
106669
  diagnostic.file.resolvedPath,
106672
- getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames())
106670
+ program.getCanonicalFileName
106673
106671
  ))}(${diagnostic.start},${diagnostic.length})`;
106674
106672
  }
106675
106673
  }
@@ -108074,8 +108072,7 @@ function listFiles(program, write) {
108074
108072
  function explainFiles(program, write) {
108075
108073
  var _a2, _b;
108076
108074
  const reasons = program.getFileIncludeReasons();
108077
- const getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames());
108078
- const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName);
108075
+ const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName);
108079
108076
  for (const file of program.getSourceFiles()) {
108080
108077
  write(`${toFileName(file, relativeFileName)}`);
108081
108078
  (_a2 = reasons.get(file.path)) == null ? void 0 : _a2.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
@@ -108133,10 +108130,9 @@ function getMatchedFileSpec(program, fileName) {
108133
108130
  const configFile = program.getCompilerOptions().configFile;
108134
108131
  if (!((_a2 = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a2.validatedFilesSpec))
108135
108132
  return void 0;
108136
- const getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames());
108137
- const filePath = getCanonicalFileName(fileName);
108133
+ const filePath = program.getCanonicalFileName(fileName);
108138
108134
  const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
108139
- return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
108135
+ return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
108140
108136
  }
108141
108137
  function getMatchedIncludeSpec(program, fileName) {
108142
108138
  var _a2, _b;
@@ -109315,8 +109311,6 @@ function createSolutionBuilderWithWatch(host, rootNames, defaultOptions, baseWat
109315
109311
  function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {
109316
109312
  const host = hostOrHostWithWatch;
109317
109313
  const hostWithWatch = hostOrHostWithWatch;
109318
- const currentDirectory = host.getCurrentDirectory();
109319
- const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
109320
109314
  const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
109321
109315
  const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions);
109322
109316
  setGetSourceFileAsHashVersioned(compilerHost);
@@ -109328,7 +109322,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
109328
109322
  compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache);
109329
109323
  let moduleResolutionCache, typeReferenceDirectiveResolutionCache;
109330
109324
  if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) {
109331
- moduleResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName);
109325
+ moduleResolutionCache = createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName);
109332
109326
  compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
109333
109327
  moduleNames,
109334
109328
  containingFile,
@@ -109342,7 +109336,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
109342
109336
  compilerHost.getModuleResolutionCache = () => moduleResolutionCache;
109343
109337
  }
109344
109338
  if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) {
109345
- typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
109339
+ typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
109346
109340
  compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
109347
109341
  typeDirectiveNames,
109348
109342
  containingFile,
@@ -109359,8 +109353,6 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
109359
109353
  const state = {
109360
109354
  host,
109361
109355
  hostWithWatch,
109362
- currentDirectory,
109363
- getCanonicalFileName,
109364
109356
  parseConfigFileHost: parseConfigHostFromCompilerHostLike(host),
109365
109357
  write: maybeBind(host, host.trace),
109366
109358
  options,
@@ -109404,7 +109396,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
109404
109396
  return state;
109405
109397
  }
109406
109398
  function toPath2(state, fileName) {
109407
- return toPath(fileName, state.currentDirectory, state.getCanonicalFileName);
109399
+ return toPath(fileName, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
109408
109400
  }
109409
109401
  function toResolvedConfigFilePath(state, fileName) {
109410
109402
  const { resolvedConfigFilePaths } = state;
@@ -109447,7 +109439,7 @@ function parseConfigFile(state, configFileName, configFilePath) {
109447
109439
  return parsed;
109448
109440
  }
109449
109441
  function resolveProjectName(state, name) {
109450
- return resolveConfigFileProjectName(resolvePath(state.currentDirectory, name));
109442
+ return resolveConfigFileProjectName(resolvePath(state.compilerHost.getCurrentDirectory(), name));
109451
109443
  }
109452
109444
  function createBuildOrder(state, roots) {
109453
109445
  const temporaryMarks = /* @__PURE__ */ new Map();
@@ -109656,7 +109648,7 @@ function createUpdateOutputFileStampsProject(state, project, projectPath, config
109656
109648
  projectPath,
109657
109649
  buildOrder,
109658
109650
  getCompilerOptions: () => config.options,
109659
- getCurrentDirectory: () => state.currentDirectory,
109651
+ getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
109660
109652
  updateOutputFileStatmps: () => {
109661
109653
  updateOutputTimestamps(state, config, projectPath);
109662
109654
  updateOutputFileStampsPending = false;
@@ -109681,7 +109673,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
109681
109673
  projectPath,
109682
109674
  buildOrder,
109683
109675
  getCompilerOptions: () => config.options,
109684
- getCurrentDirectory: () => state.currentDirectory,
109676
+ getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
109685
109677
  getBuilderProgram: () => withProgramOrUndefined(identity),
109686
109678
  getProgram: () => withProgramOrUndefined(
109687
109679
  (program2) => program2.getProgramOrUndefined()
@@ -109737,7 +109729,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
109737
109729
  projectPath,
109738
109730
  buildOrder,
109739
109731
  getCompilerOptions: () => config.options,
109740
- getCurrentDirectory: () => state.currentDirectory,
109732
+ getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
109741
109733
  emit: (writeFile2, customTransformers) => {
109742
109734
  if (step !== 4 /* EmitBundle */)
109743
109735
  return invalidatedProjectOfBundle;
@@ -110844,7 +110836,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
110844
110836
  fileOrDirectory,
110845
110837
  fileOrDirectoryPath: toPath2(state, fileOrDirectory),
110846
110838
  configFileName: resolved,
110847
- currentDirectory: state.currentDirectory,
110839
+ currentDirectory: state.compilerHost.getCurrentDirectory(),
110848
110840
  options: parsed.options,
110849
110841
  program: state.builderPrograms.get(resolvedPath) || ((_a2 = getCachedParsedConfigFile(state, resolvedPath)) == null ? void 0 : _a2.fileNames),
110850
110842
  useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames,
@@ -110949,7 +110941,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
110949
110941
  };
110950
110942
  }
110951
110943
  function relName(state, path) {
110952
- return convertToRelativePath(path, state.currentDirectory, (f) => state.getCanonicalFileName(f));
110944
+ return convertToRelativePath(path, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
110953
110945
  }
110954
110946
  function reportStatus(state, message, ...args) {
110955
110947
  state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args));