typescript 5.2.0-dev.20230706 → 5.2.0-dev.20230708

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.
@@ -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-dev.20230706`;
38
+ version = `${versionMajorMinor}.0-dev.20230708`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -1464,8 +1464,8 @@ var ts = (() => {
1464
1464
  }
1465
1465
  return false;
1466
1466
  }
1467
- function createGetCanonicalFileName(useCaseSensitiveFileNames) {
1468
- return useCaseSensitiveFileNames ? identity : toFileNameLowerCase;
1467
+ function createGetCanonicalFileName(useCaseSensitiveFileNames2) {
1468
+ return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase;
1469
1469
  }
1470
1470
  function patternText({ prefix, suffix }) {
1471
1471
  return `${prefix}*${suffix}`;
@@ -5425,10 +5425,10 @@ ${lanes.join("\n")}
5425
5425
  pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
5426
5426
  }
5427
5427
  }
5428
- function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
5428
+ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
5429
5429
  const fileWatcherCallbacks = createMultiMap();
5430
5430
  const dirWatchers = /* @__PURE__ */ new Map();
5431
- const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames);
5431
+ const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
5432
5432
  return nonPollingWatchFile;
5433
5433
  function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
5434
5434
  const filePath = toCanonicalName(fileName);
@@ -5504,8 +5504,8 @@ ${lanes.join("\n")}
5504
5504
  pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue");
5505
5505
  }
5506
5506
  }
5507
- function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
5508
- const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
5507
+ function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) {
5508
+ const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
5509
5509
  const path = toCanonicalFileName(name);
5510
5510
  const existing = cache.get(path);
5511
5511
  if (existing) {
@@ -5555,7 +5555,7 @@ ${lanes.join("\n")}
5555
5555
  }
5556
5556
  function createDirectoryWatcherSupportingRecursive({
5557
5557
  watchDirectory,
5558
- useCaseSensitiveFileNames,
5558
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
5559
5559
  getCurrentDirectory,
5560
5560
  getAccessibleSortedChildDirectories,
5561
5561
  fileSystemEntryExists,
@@ -5567,8 +5567,8 @@ ${lanes.join("\n")}
5567
5567
  const callbackCache = createMultiMap();
5568
5568
  const cacheToUpdateChildWatches = /* @__PURE__ */ new Map();
5569
5569
  let timerToUpdateChildWatches;
5570
- const filePathComparer = getStringComparer(!useCaseSensitiveFileNames);
5571
- const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames);
5570
+ const filePathComparer = getStringComparer(!useCaseSensitiveFileNames2);
5571
+ const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames2);
5572
5572
  return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options);
5573
5573
  function createDirectoryWatcher(dirName, options, callback) {
5574
5574
  const dirPath = toCanonicalFilePath(dirName);
@@ -5735,12 +5735,12 @@ ${lanes.join("\n")}
5735
5735
  }
5736
5736
  }
5737
5737
  function isIgnoredPath(path, options) {
5738
- return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames, getCurrentDirectory);
5738
+ return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
5739
5739
  }
5740
5740
  function isInPath(path, searchPath) {
5741
5741
  if (stringContains(path, searchPath))
5742
5742
  return true;
5743
- if (useCaseSensitiveFileNames)
5743
+ if (useCaseSensitiveFileNames2)
5744
5744
  return false;
5745
5745
  return stringContains(toCanonicalFilePath(path), searchPath);
5746
5746
  }
@@ -5758,14 +5758,14 @@ ${lanes.join("\n")}
5758
5758
  }
5759
5759
  };
5760
5760
  }
5761
- function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames, getCurrentDirectory) {
5762
- return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames, getCurrentDirectory()));
5761
+ function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
5762
+ return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames2, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2, getCurrentDirectory()));
5763
5763
  }
5764
- function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory) {
5764
+ function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
5765
5765
  return (eventName, relativeFileName) => {
5766
5766
  if (eventName === "rename") {
5767
5767
  const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName));
5768
- if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames, getCurrentDirectory)) {
5768
+ if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) {
5769
5769
  callback(fileName);
5770
5770
  }
5771
5771
  }
@@ -5778,7 +5778,7 @@ ${lanes.join("\n")}
5778
5778
  clearTimeout: clearTimeout2,
5779
5779
  fsWatchWorker,
5780
5780
  fileSystemEntryExists,
5781
- useCaseSensitiveFileNames,
5781
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
5782
5782
  getCurrentDirectory,
5783
5783
  fsSupportsRecursiveFsWatch,
5784
5784
  getAccessibleSortedChildDirectories,
@@ -5850,7 +5850,7 @@ ${lanes.join("\n")}
5850
5850
  );
5851
5851
  case 5 /* UseFsEventsOnParentDirectory */:
5852
5852
  if (!nonPollingWatchFile) {
5853
- nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames);
5853
+ nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
5854
5854
  }
5855
5855
  return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
5856
5856
  default:
@@ -5899,7 +5899,7 @@ ${lanes.join("\n")}
5899
5899
  return fsWatch(
5900
5900
  directoryName,
5901
5901
  1 /* Directory */,
5902
- createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory),
5902
+ createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
5903
5903
  recursive,
5904
5904
  500 /* Medium */,
5905
5905
  getFallbackOptions(options)
@@ -5907,7 +5907,7 @@ ${lanes.join("\n")}
5907
5907
  }
5908
5908
  if (!hostRecursiveDirectoryWatcher) {
5909
5909
  hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({
5910
- useCaseSensitiveFileNames,
5910
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
5911
5911
  getCurrentDirectory,
5912
5912
  fileSystemEntryExists,
5913
5913
  getAccessibleSortedChildDirectories,
@@ -5953,7 +5953,7 @@ ${lanes.join("\n")}
5953
5953
  return fsWatch(
5954
5954
  directoryName,
5955
5955
  1 /* Directory */,
5956
- createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory),
5956
+ createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
5957
5957
  recursive,
5958
5958
  500 /* Medium */,
5959
5959
  getFallbackOptions(watchDirectoryOptions)
@@ -5981,7 +5981,7 @@ ${lanes.join("\n")}
5981
5981
  function pollingWatchFile(fileName, callback, pollingInterval, options) {
5982
5982
  return createSingleWatcherPerName(
5983
5983
  pollingWatches,
5984
- useCaseSensitiveFileNames,
5984
+ useCaseSensitiveFileNames2,
5985
5985
  fileName,
5986
5986
  callback,
5987
5987
  (cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options)
@@ -5990,7 +5990,7 @@ ${lanes.join("\n")}
5990
5990
  function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
5991
5991
  return createSingleWatcherPerName(
5992
5992
  recursive ? fsWatchesRecursive : fsWatches,
5993
- useCaseSensitiveFileNames,
5993
+ useCaseSensitiveFileNames2,
5994
5994
  fileOrDirectory,
5995
5995
  callback,
5996
5996
  (cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions)
@@ -6149,7 +6149,7 @@ ${lanes.join("\n")}
6149
6149
  const Buffer2 = require("buffer").Buffer;
6150
6150
  const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
6151
6151
  const platform = _os.platform();
6152
- const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
6152
+ const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
6153
6153
  const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
6154
6154
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
6155
6155
  const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
@@ -6160,7 +6160,7 @@ ${lanes.join("\n")}
6160
6160
  setTimeout,
6161
6161
  clearTimeout,
6162
6162
  fsWatchWorker,
6163
- useCaseSensitiveFileNames,
6163
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
6164
6164
  getCurrentDirectory,
6165
6165
  fileSystemEntryExists,
6166
6166
  // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
@@ -6177,7 +6177,7 @@ ${lanes.join("\n")}
6177
6177
  const nodeSystem = {
6178
6178
  args: process.argv.slice(2),
6179
6179
  newLine: _os.EOL,
6180
- useCaseSensitiveFileNames,
6180
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
6181
6181
  write(s) {
6182
6182
  process.stdout.write(s);
6183
6183
  },
@@ -6306,12 +6306,12 @@ ${lanes.join("\n")}
6306
6306
  for (const node of profile.nodes) {
6307
6307
  if (node.callFrame.url) {
6308
6308
  const url = normalizeSlashes(node.callFrame.url);
6309
- if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames)) {
6309
+ if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) {
6310
6310
  node.callFrame.url = getRelativePathToDirectoryOrUrl(
6311
6311
  fileUrlRoot,
6312
6312
  url,
6313
6313
  fileUrlRoot,
6314
- createGetCanonicalFileName(useCaseSensitiveFileNames),
6314
+ createGetCanonicalFileName(useCaseSensitiveFileNames2),
6315
6315
  /*isAbsolutePathAnUrl*/
6316
6316
  true
6317
6317
  );
@@ -6491,7 +6491,7 @@ ${lanes.join("\n")}
6491
6491
  }
6492
6492
  }
6493
6493
  function readDirectory(path, extensions, excludes, includes, depth) {
6494
- return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
6494
+ return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
6495
6495
  }
6496
6496
  function fileSystemEntryExists(path, entryKind) {
6497
6497
  const originalStackTraceLimit = Error.stackTraceLimit;
@@ -9739,7 +9739,7 @@ ${lanes.join("\n")}
9739
9739
  if (withMinus)
9740
9740
  start2--;
9741
9741
  error2(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal);
9742
- return { type: 9 /* NumericLiteral */, value: tokenValue };
9742
+ return 9 /* NumericLiteral */;
9743
9743
  }
9744
9744
  } else {
9745
9745
  mainFragment = scanNumberFragment();
@@ -9779,20 +9779,18 @@ ${lanes.join("\n")}
9779
9779
  }
9780
9780
  if (tokenFlags & 8192 /* ContainsLeadingZero */) {
9781
9781
  error2(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start2, end2 - start2);
9782
- return { type: 9 /* NumericLiteral */, value: "" + +result };
9782
+ tokenValue = "" + +result;
9783
+ return 9 /* NumericLiteral */;
9783
9784
  }
9784
9785
  if (decimalFragment !== void 0 || tokenFlags & 16 /* Scientific */) {
9785
9786
  checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16 /* Scientific */));
9786
- return {
9787
- type: 9 /* NumericLiteral */,
9788
- value: "" + +result
9789
- // if value is not an integer, it can be safely coerced to a number
9790
- };
9787
+ tokenValue = "" + +result;
9788
+ return 9 /* NumericLiteral */;
9791
9789
  } else {
9792
9790
  tokenValue = result;
9793
9791
  const type = checkBigIntSuffix();
9794
9792
  checkForIdentifierStartAfterNumericLiteral(start2);
9795
- return { type, value: tokenValue };
9793
+ return type;
9796
9794
  }
9797
9795
  }
9798
9796
  function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) {
@@ -10401,7 +10399,7 @@ ${lanes.join("\n")}
10401
10399
  return token = 41 /* MinusToken */;
10402
10400
  case 46 /* dot */:
10403
10401
  if (isDigit(text.charCodeAt(pos + 1))) {
10404
- tokenValue = scanNumber().value;
10402
+ scanNumber();
10405
10403
  return token = 9 /* NumericLiteral */;
10406
10404
  }
10407
10405
  if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {
@@ -10519,8 +10517,7 @@ ${lanes.join("\n")}
10519
10517
  case 55 /* _7 */:
10520
10518
  case 56 /* _8 */:
10521
10519
  case 57 /* _9 */:
10522
- ({ type: token, value: tokenValue } = scanNumber());
10523
- return token;
10520
+ return token = scanNumber();
10524
10521
  case 58 /* colon */:
10525
10522
  pos++;
10526
10523
  return token = 59 /* ColonToken */;
@@ -18405,7 +18402,7 @@ ${lanes.join("\n")}
18405
18402
  function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
18406
18403
  return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
18407
18404
  }
18408
- function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
18405
+ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
18409
18406
  path = normalizePath(path);
18410
18407
  currentDirectory = normalizePath(currentDirectory);
18411
18408
  const absolutePath = combinePaths(currentDirectory, path);
@@ -18414,22 +18411,22 @@ ${lanes.join("\n")}
18414
18411
  includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
18415
18412
  includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
18416
18413
  excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
18417
- basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames)
18414
+ basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames2)
18418
18415
  };
18419
18416
  }
18420
- function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {
18421
- return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
18417
+ function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
18418
+ return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
18422
18419
  }
18423
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
18420
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
18424
18421
  path = normalizePath(path);
18425
18422
  currentDirectory = normalizePath(currentDirectory);
18426
- const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
18427
- const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames));
18428
- const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
18429
- const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);
18423
+ const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
18424
+ const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2));
18425
+ const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2);
18426
+ const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2);
18430
18427
  const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]];
18431
18428
  const visited = /* @__PURE__ */ new Map();
18432
- const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames);
18429
+ const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2);
18433
18430
  for (const basePath of patterns.basePaths) {
18434
18431
  visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
18435
18432
  }
@@ -18471,7 +18468,7 @@ ${lanes.join("\n")}
18471
18468
  }
18472
18469
  }
18473
18470
  }
18474
- function getBasePaths(path, includes, useCaseSensitiveFileNames) {
18471
+ function getBasePaths(path, includes, useCaseSensitiveFileNames2) {
18475
18472
  const basePaths = [path];
18476
18473
  if (includes) {
18477
18474
  const includeBasePaths = [];
@@ -18479,9 +18476,9 @@ ${lanes.join("\n")}
18479
18476
  const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
18480
18477
  includeBasePaths.push(getIncludeBasePath(absolute));
18481
18478
  }
18482
- includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames));
18479
+ includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
18483
18480
  for (const includeBasePath of includeBasePaths) {
18484
- if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames))) {
18481
+ if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames2))) {
18485
18482
  basePaths.push(includeBasePath);
18486
18483
  }
18487
18484
  }
@@ -37272,19 +37269,19 @@ ${lanes.join("\n")}
37272
37269
  const wildcardFiles = arrayFrom(wildcardFileMap.values());
37273
37270
  return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values()));
37274
37271
  }
37275
- function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames, currentDirectory) {
37272
+ function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames2, currentDirectory) {
37276
37273
  const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec;
37277
37274
  if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs))
37278
37275
  return false;
37279
37276
  basePath = normalizePath(basePath);
37280
- const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames);
37277
+ const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2);
37281
37278
  if (validatedFilesSpec) {
37282
37279
  for (const fileName of validatedFilesSpec) {
37283
37280
  if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck)
37284
37281
  return false;
37285
37282
  }
37286
37283
  }
37287
- return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath);
37284
+ return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath);
37288
37285
  }
37289
37286
  function invalidDotDotAfterRecursiveWildcard(s) {
37290
37287
  const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/");
@@ -37294,17 +37291,17 @@ ${lanes.join("\n")}
37294
37291
  const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../");
37295
37292
  return lastDotIndex > wildcardIndex;
37296
37293
  }
37297
- function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory) {
37294
+ function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) {
37298
37295
  return matchesExcludeWorker(
37299
37296
  pathToCheck,
37300
37297
  filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)),
37301
- useCaseSensitiveFileNames,
37298
+ useCaseSensitiveFileNames2,
37302
37299
  currentDirectory
37303
37300
  );
37304
37301
  }
37305
- function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath) {
37302
+ function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) {
37306
37303
  const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude");
37307
- const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames);
37304
+ const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2);
37308
37305
  if (!excludeRegex)
37309
37306
  return false;
37310
37307
  if (excludeRegex.test(pathToCheck))
@@ -37334,9 +37331,9 @@ ${lanes.join("\n")}
37334
37331
  return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
37335
37332
  }
37336
37333
  }
37337
- function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames) {
37334
+ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames2) {
37338
37335
  const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
37339
- const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i");
37336
+ const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
37340
37337
  const wildcardDirectories = {};
37341
37338
  if (include !== void 0) {
37342
37339
  const recursiveKeys = [];
@@ -37345,7 +37342,7 @@ ${lanes.join("\n")}
37345
37342
  if (excludeRegex && excludeRegex.test(spec)) {
37346
37343
  continue;
37347
37344
  }
37348
- const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames);
37345
+ const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
37349
37346
  if (match) {
37350
37347
  const { key, flags } = match;
37351
37348
  const existingFlags = wildcardDirectories[key];
@@ -37360,7 +37357,7 @@ ${lanes.join("\n")}
37360
37357
  for (const key in wildcardDirectories) {
37361
37358
  if (hasProperty(wildcardDirectories, key)) {
37362
37359
  for (const recursiveKey of recursiveKeys) {
37363
- if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
37360
+ if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames2)) {
37364
37361
  delete wildcardDirectories[key];
37365
37362
  }
37366
37363
  }
@@ -37369,20 +37366,20 @@ ${lanes.join("\n")}
37369
37366
  }
37370
37367
  return wildcardDirectories;
37371
37368
  }
37372
- function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames) {
37369
+ function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
37373
37370
  const match = wildcardDirectoryPattern.exec(spec);
37374
37371
  if (match) {
37375
37372
  const questionWildcardIndex = spec.indexOf("?");
37376
37373
  const starWildcardIndex = spec.indexOf("*");
37377
37374
  const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
37378
37375
  return {
37379
- key: useCaseSensitiveFileNames ? match[0] : toFileNameLowerCase(match[0]),
37376
+ key: useCaseSensitiveFileNames2 ? match[0] : toFileNameLowerCase(match[0]),
37380
37377
  flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
37381
37378
  };
37382
37379
  }
37383
37380
  if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
37384
37381
  return {
37385
- key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : toFileNameLowerCase(spec)),
37382
+ key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames2 ? spec : toFileNameLowerCase(spec)),
37386
37383
  flags: 1 /* Recursive */
37387
37384
  };
37388
37385
  }
@@ -39068,6 +39065,18 @@ ${lanes.join("\n")}
39068
39065
  result.push("JSON");
39069
39066
  return result.join(", ");
39070
39067
  }
39068
+ function extensionsToExtensionsArray(extensions) {
39069
+ const result = [];
39070
+ if (extensions & 1 /* TypeScript */)
39071
+ result.push(...supportedTSImplementationExtensions);
39072
+ if (extensions & 2 /* JavaScript */)
39073
+ result.push(...supportedJSExtensionsFlat);
39074
+ if (extensions & 4 /* Declaration */)
39075
+ result.push(...supportedDeclarationExtensions);
39076
+ if (extensions & 8 /* Json */)
39077
+ result.push(".json" /* Json */);
39078
+ return result;
39079
+ }
39071
39080
  function resolvedTypeScriptOnly(resolved) {
39072
39081
  if (!resolved) {
39073
39082
  return void 0;
@@ -39240,8 +39249,8 @@ ${lanes.join("\n")}
39240
39249
  return typeRoots;
39241
39250
  }
39242
39251
  function arePathsEqual(path1, path2, host) {
39243
- const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
39244
- return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
39252
+ const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
39253
+ return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */;
39245
39254
  }
39246
39255
  function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
39247
39256
  const resolvedFileName = realPath(fileName, host, traceEnabled);
@@ -40504,7 +40513,7 @@ ${lanes.join("\n")}
40504
40513
  arrayIsEqualTo
40505
40514
  );
40506
40515
  for (const conditions of conditionSets) {
40507
- const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions };
40516
+ const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host };
40508
40517
  const exportResolutions = loadEntrypointsFromExportMap(
40509
40518
  packageJsonInfo,
40510
40519
  packageJsonInfo.contents.packageJsonContent.exports,
@@ -40536,23 +40545,42 @@ ${lanes.join("\n")}
40536
40545
  return entrypoints;
40537
40546
  function loadEntrypointsFromTargetExports(target) {
40538
40547
  var _a, _b;
40539
- if (typeof target === "string" && startsWith(target, "./") && target.indexOf("*") === -1) {
40540
- const partsAfterFirst = getPathComponents(target).slice(2);
40541
- if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
40542
- return false;
40543
- }
40544
- const resolvedTarget = combinePaths(scope.packageDirectory, target);
40545
- const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
40546
- const result = loadFileNameFromPackageJsonField(
40547
- extensions,
40548
- finalPath,
40549
- /*onlyRecordFailures*/
40550
- false,
40551
- state
40552
- );
40553
- if (result) {
40554
- entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
40555
- return true;
40548
+ if (typeof target === "string" && startsWith(target, "./")) {
40549
+ if (target.indexOf("*") >= 0 && state.host.readDirectory) {
40550
+ if (target.indexOf("*") !== target.lastIndexOf("*")) {
40551
+ return false;
40552
+ }
40553
+ state.host.readDirectory(
40554
+ scope.packageDirectory,
40555
+ extensionsToExtensionsArray(extensions),
40556
+ /*excludes*/
40557
+ void 0,
40558
+ [changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))]
40559
+ ).forEach((entry) => {
40560
+ entrypoints = appendIfUnique(entrypoints, {
40561
+ path: entry,
40562
+ ext: getAnyExtensionFromPath(entry),
40563
+ resolvedUsingTsExtension: void 0
40564
+ });
40565
+ });
40566
+ } else {
40567
+ const partsAfterFirst = getPathComponents(target).slice(2);
40568
+ if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
40569
+ return false;
40570
+ }
40571
+ const resolvedTarget = combinePaths(scope.packageDirectory, target);
40572
+ const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
40573
+ const result = loadFileNameFromPackageJsonField(
40574
+ extensions,
40575
+ finalPath,
40576
+ /*onlyRecordFailures*/
40577
+ false,
40578
+ state
40579
+ );
40580
+ if (result) {
40581
+ entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
40582
+ return true;
40583
+ }
40556
40584
  }
40557
40585
  } else if (Array.isArray(target)) {
40558
40586
  for (const t of target) {
@@ -41111,13 +41139,10 @@ ${lanes.join("\n")}
41111
41139
  function combineDirectoryPath(root, dir) {
41112
41140
  return ensureTrailingDirectorySeparator(combinePaths(root, dir));
41113
41141
  }
41114
- function useCaseSensitiveFileNames() {
41115
- return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
41116
- }
41117
41142
  function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
41118
41143
  var _a, _b, _c, _d;
41119
- if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
41120
- const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
41144
+ if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
41145
+ const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
41121
41146
  const commonSourceDirGuesses = [];
41122
41147
  if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
41123
41148
  const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
@@ -41146,7 +41171,7 @@ ${lanes.join("\n")}
41146
41171
  for (const commonSourceDirGuess of commonSourceDirGuesses) {
41147
41172
  const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
41148
41173
  for (const candidateDir of candidateDirectories) {
41149
- if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
41174
+ if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
41150
41175
  const pathFragment = finalPath.slice(candidateDir.length + 1);
41151
41176
  const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
41152
41177
  const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */];
@@ -41156,7 +41181,7 @@ ${lanes.join("\n")}
41156
41181
  for (const possibleExt of inputExts) {
41157
41182
  if (!extensionIsOk(extensions, possibleExt))
41158
41183
  continue;
41159
- const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
41184
+ const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state));
41160
41185
  if (state.host.fileExists(possibleInputWithInputExtension)) {
41161
41186
  return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
41162
41187
  extensions,
@@ -41572,6 +41597,9 @@ ${lanes.join("\n")}
41572
41597
  trace(state.host, diagnostic, ...args);
41573
41598
  }
41574
41599
  }
41600
+ function useCaseSensitiveFileNames(state) {
41601
+ return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
41602
+ }
41575
41603
  var typeScriptVersion, nodeModulesAtTypes, NodeResolutionFeatures, nodeModulesPathPart, mangledScopedPackageSeparator;
41576
41604
  var init_moduleNameResolver = __esm({
41577
41605
  "src/compiler/moduleNameResolver.ts"() {
@@ -45151,7 +45179,7 @@ ${lanes.join("\n")}
45151
45179
  for (const key of getOwnKeys(exports)) {
45152
45180
  if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
45153
45181
  const subTarget = exports[key];
45154
- const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions);
45182
+ const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
45155
45183
  if (result) {
45156
45184
  return result;
45157
45185
  }
@@ -46209,7 +46237,7 @@ ${lanes.join("\n")}
46209
46237
  };
46210
46238
  var amalgamatedDuplicates;
46211
46239
  var reverseMappedCache = /* @__PURE__ */ new Map();
46212
- var inInferTypeForHomomorphicMappedType = false;
46240
+ var homomorphicMappedTypeInferenceStack = [];
46213
46241
  var ambientModulesCache;
46214
46242
  var patternAmbientModules;
46215
46243
  var patternAmbientModuleAugmentations;
@@ -50800,6 +50828,7 @@ ${lanes.join("\n")}
50800
50828
  );
50801
50829
  }
50802
50830
  function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
50831
+ var _a;
50803
50832
  const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
50804
50833
  if (suppressAny)
50805
50834
  context.flags &= ~256 /* SuppressAnyReturnType */;
@@ -50935,6 +50964,20 @@ ${lanes.join("\n")}
50935
50964
  if (typeArguments) {
50936
50965
  node.typeArguments = factory.createNodeArray(typeArguments);
50937
50966
  }
50967
+ if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 330 /* JSDocSignature */ && signature.declaration.parent.kind === 346 /* JSDocOverloadTag */) {
50968
+ const comment = getTextOfNode(
50969
+ signature.declaration.parent.parent,
50970
+ /*includeTrivia*/
50971
+ true
50972
+ ).slice(2, -2).split(/\r\n|\n|\r/).map((line) => line.replace(/^\s+/, " ")).join("\n");
50973
+ addSyntheticLeadingComment(
50974
+ node,
50975
+ 3 /* MultiLineCommentTrivia */,
50976
+ comment,
50977
+ /*hasTrailingNewLine*/
50978
+ true
50979
+ );
50980
+ }
50938
50981
  cleanup == null ? void 0 : cleanup();
50939
50982
  return node;
50940
50983
  }
@@ -65598,17 +65641,18 @@ ${lanes.join("\n")}
65598
65641
  );
65599
65642
  }
65600
65643
  function inferTypeForHomomorphicMappedType(source, target, constraint) {
65601
- if (inInferTypeForHomomorphicMappedType) {
65602
- return void 0;
65644
+ const cacheKey = source.id + "," + target.id + "," + constraint.id;
65645
+ if (reverseMappedCache.has(cacheKey)) {
65646
+ return reverseMappedCache.get(cacheKey);
65603
65647
  }
65604
- const key = source.id + "," + target.id + "," + constraint.id;
65605
- if (reverseMappedCache.has(key)) {
65606
- return reverseMappedCache.get(key);
65648
+ const recursionKey = source.id + "," + (target.target || target).id;
65649
+ if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
65650
+ return void 0;
65607
65651
  }
65608
- inInferTypeForHomomorphicMappedType = true;
65652
+ homomorphicMappedTypeInferenceStack.push(recursionKey);
65609
65653
  const type = createReverseMappedType(source, target, constraint);
65610
- inInferTypeForHomomorphicMappedType = false;
65611
- reverseMappedCache.set(key, type);
65654
+ homomorphicMappedTypeInferenceStack.pop();
65655
+ reverseMappedCache.set(cacheKey, type);
65612
65656
  return type;
65613
65657
  }
65614
65658
  function isPartiallyInferableType(type) {
@@ -116955,14 +116999,14 @@ ${lanes.join("\n")}
116955
116999
  });
116956
117000
 
116957
117001
  // src/compiler/watchUtilities.ts
116958
- function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) {
117002
+ function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) {
116959
117003
  if (!host.getDirectories || !host.readDirectory) {
116960
117004
  return void 0;
116961
117005
  }
116962
117006
  const cachedReadDirectoryResult = /* @__PURE__ */ new Map();
116963
- const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
117007
+ const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
116964
117008
  return {
116965
- useCaseSensitiveFileNames,
117009
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
116966
117010
  fileExists,
116967
117011
  readFile: (path, encoding) => host.readFile(path, encoding),
116968
117012
  directoryExists: host.directoryExists && directoryExists,
@@ -117084,7 +117128,7 @@ ${lanes.join("\n")}
117084
117128
  const rootResult = tryReadDirectory2(rootDir, rootDirPath);
117085
117129
  let rootSymLinkResult;
117086
117130
  if (rootResult !== void 0) {
117087
- return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
117131
+ return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath);
117088
117132
  }
117089
117133
  return host.readDirectory(rootDir, extensions, excludes, includes, depth);
117090
117134
  function getFileSystemEntries(dir) {
@@ -117279,7 +117323,7 @@ ${lanes.join("\n")}
117279
117323
  program,
117280
117324
  extraFileExtensions,
117281
117325
  currentDirectory,
117282
- useCaseSensitiveFileNames,
117326
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
117283
117327
  writeLog,
117284
117328
  toPath: toPath3
117285
117329
  }) {
@@ -117295,7 +117339,7 @@ ${lanes.join("\n")}
117295
117339
  writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
117296
117340
  return true;
117297
117341
  }
117298
- if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
117342
+ if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames2, currentDirectory)) {
117299
117343
  writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`);
117300
117344
  return true;
117301
117345
  }
@@ -117352,7 +117396,7 @@ ${lanes.join("\n")}
117352
117396
  function createExcludeHandlingAddWatch(key) {
117353
117397
  return (file, cb, flags, options, detailInfo1, detailInfo2) => {
117354
117398
  var _a;
117355
- return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames(), ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)) || "") ? factory2[key].call(
117399
+ return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2(), ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)) || "") ? factory2[key].call(
117356
117400
  /*thisArgs*/
117357
117401
  void 0,
117358
117402
  file,
@@ -117364,7 +117408,7 @@ ${lanes.join("\n")}
117364
117408
  ) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2);
117365
117409
  };
117366
117410
  }
117367
- function useCaseSensitiveFileNames() {
117411
+ function useCaseSensitiveFileNames2() {
117368
117412
  return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames();
117369
117413
  }
117370
117414
  function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
@@ -124499,12 +124543,12 @@ ${lanes.join("\n")}
124499
124543
  return true;
124500
124544
  const isJsonFile = fileExtensionIs(fileName, ".json" /* Json */);
124501
124545
  const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
124502
- const useCaseSensitiveFileNames = program.useCaseSensitiveFileNames();
124546
+ const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames();
124503
124547
  return find((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => {
124504
124548
  if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */))
124505
124549
  return false;
124506
124550
  const pattern = getPatternFromSpec(includeSpec, basePath, "files");
124507
- return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames).test(fileName);
124551
+ return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
124508
124552
  });
124509
124553
  }
124510
124554
  function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
@@ -124708,7 +124752,7 @@ ${lanes.join("\n")}
124708
124752
  return result;
124709
124753
  }
124710
124754
  function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
124711
- const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
124755
+ const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
124712
124756
  const compilerHost = {
124713
124757
  getSourceFile: createGetSourceFile(
124714
124758
  (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
@@ -124724,8 +124768,8 @@ ${lanes.join("\n")}
124724
124768
  (path) => host.directoryExists(path)
124725
124769
  ),
124726
124770
  getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
124727
- useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
124728
- getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames),
124771
+ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
124772
+ getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2),
124729
124773
  getNewLine: () => getNewLineCharacter(getCompilerOptions()),
124730
124774
  fileExists: (f) => host.fileExists(f),
124731
124775
  readFile: (f) => host.readFile(f),
@@ -125006,7 +125050,7 @@ ${lanes.join("\n")}
125006
125050
  const sourceFilesCache = /* @__PURE__ */ new Map();
125007
125051
  let missingFilePathsRequestedForRelease;
125008
125052
  let hasChangedCompilerOptions = false;
125009
- const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
125053
+ const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
125010
125054
  const currentDirectory = host.getCurrentDirectory();
125011
125055
  const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram: createProgram2 } = host;
125012
125056
  let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host;
@@ -125014,7 +125058,7 @@ ${lanes.join("\n")}
125014
125058
  let configFileParsingDiagnostics;
125015
125059
  let canConfigFileJsonReportNoInputFiles = false;
125016
125060
  let hasChangedConfigFileParsingErrors = false;
125017
- const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames);
125061
+ const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2);
125018
125062
  const directoryStructureHost = cachedDirectoryStructureHost || host;
125019
125063
  const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost);
125020
125064
  let newLine = updateNewLine();
@@ -125032,8 +125076,8 @@ ${lanes.join("\n")}
125032
125076
  Debug.assert(compilerOptions);
125033
125077
  Debug.assert(rootFileNames);
125034
125078
  const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions);
125035
- const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
125036
- writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`);
125079
+ const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
125080
+ writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`);
125037
125081
  let configFileWatcher;
125038
125082
  if (configFileName) {
125039
125083
  configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
@@ -125539,7 +125583,7 @@ ${lanes.join("\n")}
125539
125583
  options: compilerOptions,
125540
125584
  program: getCurrentBuilderProgram() || rootFileNames,
125541
125585
  currentDirectory,
125542
- useCaseSensitiveFileNames,
125586
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
125543
125587
  writeLog,
125544
125588
  toPath: toPath3
125545
125589
  }))
@@ -125629,7 +125673,7 @@ ${lanes.join("\n")}
125629
125673
  options: config.parsedCommandLine.options,
125630
125674
  program: config.parsedCommandLine.fileNames,
125631
125675
  currentDirectory,
125632
- useCaseSensitiveFileNames,
125676
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
125633
125677
  writeLog,
125634
125678
  toPath: toPath3
125635
125679
  }))
@@ -128392,6 +128436,8 @@ ${lanes.join("\n")}
128392
128436
  ScriptElementKind2["enumMemberElement"] = "enum member";
128393
128437
  ScriptElementKind2["variableElement"] = "var";
128394
128438
  ScriptElementKind2["localVariableElement"] = "local var";
128439
+ ScriptElementKind2["variableUsingElement"] = "using";
128440
+ ScriptElementKind2["variableAwaitUsingElement"] = "await using";
128395
128441
  ScriptElementKind2["functionElement"] = "function";
128396
128442
  ScriptElementKind2["localFunctionElement"] = "local function";
128397
128443
  ScriptElementKind2["memberFunctionElement"] = "method";
@@ -131525,10 +131571,10 @@ ${lanes.join("\n")}
131525
131571
  }
131526
131572
  function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) {
131527
131573
  var _a, _b;
131528
- const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host);
131574
+ const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
131529
131575
  const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, (spec) => {
131530
131576
  const pattern = getPatternFromSpec(spec, "", "exclude");
131531
- return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames) : void 0;
131577
+ return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames2) : void 0;
131532
131578
  });
131533
131579
  forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, (module2, file) => cb(
131534
131580
  module2,
@@ -133024,12 +133070,12 @@ ${lanes.join("\n")}
133024
133070
  function isDocumentRegistryEntry(entry) {
133025
133071
  return !!entry.sourceFile;
133026
133072
  }
133027
- function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) {
133028
- return createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory);
133073
+ function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
133074
+ return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
133029
133075
  }
133030
- function createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory = "", externalCache) {
133076
+ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
133031
133077
  const buckets = /* @__PURE__ */ new Map();
133032
- const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames);
133078
+ const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
133033
133079
  function reportStats() {
133034
133080
  const bucketInfoArray = arrayFrom(buckets.keys()).filter((name) => name && name.charAt(0) === "_").map((name) => {
133035
133081
  const entries = buckets.get(name);
@@ -133238,12 +133284,12 @@ ${lanes.join("\n")}
133238
133284
 
133239
133285
  // src/services/getEditsForFileRename.ts
133240
133286
  function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) {
133241
- const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host);
133242
- const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
133287
+ const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
133288
+ const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
133243
133289
  const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper);
133244
133290
  const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper);
133245
133291
  return ts_textChanges_exports.ChangeTracker.with({ host, formatContext, preferences }, (changeTracker) => {
133246
- updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames);
133292
+ updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames2);
133247
133293
  updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName);
133248
133294
  });
133249
133295
  }
@@ -133265,7 +133311,7 @@ ${lanes.join("\n")}
133265
133311
  const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName);
133266
133312
  return combinePathsSafe(getDirectoryPath(a1), rel);
133267
133313
  }
133268
- function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames) {
133314
+ function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames2) {
133269
133315
  const { configFile } = program.getCompilerOptions();
133270
133316
  if (!configFile)
133271
133317
  return;
@@ -133289,10 +133335,10 @@ ${lanes.join("\n")}
133289
133335
  /*excludes*/
133290
133336
  [],
133291
133337
  includes,
133292
- useCaseSensitiveFileNames,
133338
+ useCaseSensitiveFileNames2,
133293
133339
  currentDirectory
133294
133340
  );
133295
- if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(newFileOrDirPath)) {
133341
+ if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(newFileOrDirPath)) {
133296
133342
  changeTracker.insertNodeAfter(configFile, last(property.initializer.elements), factory.createStringLiteral(relativePath(newFileOrDirPath)));
133297
133343
  }
133298
133344
  return;
@@ -133340,7 +133386,7 @@ ${lanes.join("\n")}
133340
133386
  configDir,
133341
133387
  path,
133342
133388
  /*ignoreCase*/
133343
- !useCaseSensitiveFileNames
133389
+ !useCaseSensitiveFileNames2
133344
133390
  );
133345
133391
  }
133346
133392
  }
@@ -136654,7 +136700,7 @@ ${lanes.join("\n")}
136654
136700
  const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromTargetFile, useEsModuleSyntax);
136655
136701
  if (typeof targetFile !== "string") {
136656
136702
  if (targetFile.statements.length > 0) {
136657
- changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], body);
136703
+ moveStatementsToTargetFile(changes, program, body, targetFile, toMove);
136658
136704
  } else {
136659
136705
  changes.insertNodesAtEndOfFile(
136660
136706
  targetFile,
@@ -137447,6 +137493,67 @@ ${lanes.join("\n")}
137447
137493
  return false;
137448
137494
  }
137449
137495
  }
137496
+ function moveStatementsToTargetFile(changes, program, statements, targetFile, toMove) {
137497
+ var _a;
137498
+ const removedExports = /* @__PURE__ */ new Set();
137499
+ const targetExports = (_a = targetFile.symbol) == null ? void 0 : _a.exports;
137500
+ if (targetExports) {
137501
+ const checker = program.getTypeChecker();
137502
+ const targetToSourceExports = /* @__PURE__ */ new Map();
137503
+ for (const node of toMove.all) {
137504
+ if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node, 1 /* Export */)) {
137505
+ forEachTopLevelDeclaration(node, (declaration) => {
137506
+ var _a2;
137507
+ const targetDeclarations = canHaveSymbol(declaration) ? (_a2 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a2.declarations : void 0;
137508
+ const exportDeclaration = firstDefined(targetDeclarations, (d) => isExportDeclaration(d) ? d : isExportSpecifier(d) ? tryCast(d.parent.parent, isExportDeclaration) : void 0);
137509
+ if (exportDeclaration && exportDeclaration.moduleSpecifier) {
137510
+ targetToSourceExports.set(
137511
+ exportDeclaration,
137512
+ (targetToSourceExports.get(exportDeclaration) || /* @__PURE__ */ new Set()).add(declaration)
137513
+ );
137514
+ }
137515
+ });
137516
+ }
137517
+ }
137518
+ for (const [exportDeclaration, topLevelDeclarations] of arrayFrom(targetToSourceExports)) {
137519
+ if (exportDeclaration.exportClause && isNamedExports(exportDeclaration.exportClause) && length(exportDeclaration.exportClause.elements)) {
137520
+ const elements = exportDeclaration.exportClause.elements;
137521
+ const updatedElements = filter(elements, (elem) => find(skipAlias(elem.symbol, checker).declarations, (d) => isTopLevelDeclaration(d) && topLevelDeclarations.has(d)) === void 0);
137522
+ if (length(updatedElements) === 0) {
137523
+ changes.deleteNode(targetFile, exportDeclaration);
137524
+ removedExports.add(exportDeclaration);
137525
+ continue;
137526
+ }
137527
+ if (length(updatedElements) < length(elements)) {
137528
+ changes.replaceNode(
137529
+ targetFile,
137530
+ exportDeclaration,
137531
+ factory.updateExportDeclaration(
137532
+ exportDeclaration,
137533
+ exportDeclaration.modifiers,
137534
+ exportDeclaration.isTypeOnly,
137535
+ factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)),
137536
+ exportDeclaration.moduleSpecifier,
137537
+ exportDeclaration.assertClause
137538
+ )
137539
+ );
137540
+ }
137541
+ }
137542
+ }
137543
+ }
137544
+ const lastReExport = findLast(targetFile.statements, (n) => isExportDeclaration(n) && !!n.moduleSpecifier && !removedExports.has(n));
137545
+ if (lastReExport) {
137546
+ changes.insertNodesBefore(
137547
+ targetFile,
137548
+ lastReExport,
137549
+ statements,
137550
+ /*blankLineBetween*/
137551
+ true
137552
+ );
137553
+ } else {
137554
+ changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], statements);
137555
+ }
137556
+ }
137450
137557
  function getOverloadRangeToMove(sourceFile, statement) {
137451
137558
  if (isFunctionLikeDeclaration(statement)) {
137452
137559
  const declarations = statement.symbol.declarations;
@@ -141482,10 +141589,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141482
141589
  host.log(message);
141483
141590
  }
141484
141591
  }
141485
- const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host);
141486
- const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
141592
+ const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
141593
+ const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
141487
141594
  const sourceMapper = getSourceMapper({
141488
- useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
141595
+ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
141489
141596
  getCurrentDirectory: () => currentDirectory,
141490
141597
  getProgram,
141491
141598
  fileExists: maybeBind(host, host.fileExists),
@@ -141533,7 +141640,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141533
141640
  getSourceFileByPath: getOrCreateSourceFileByPath,
141534
141641
  getCancellationToken: () => cancellationToken,
141535
141642
  getCanonicalFileName,
141536
- useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,
141643
+ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
141537
141644
  getNewLine: () => getNewLineCharacter(newSettings),
141538
141645
  getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2),
141539
141646
  writeFile: noop,
@@ -141577,7 +141684,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141577
141684
  compilerHost.getSourceFile = getSourceFileWithCache;
141578
141685
  (_c = host.setCompilerHost) == null ? void 0 : _c.call(host, compilerHost);
141579
141686
  const parseConfigHost = {
141580
- useCaseSensitiveFileNames,
141687
+ useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
141581
141688
  fileExists: (fileName) => compilerHost.fileExists(fileName),
141582
141689
  readFile: (fileName) => compilerHost.readFile(fileName),
141583
141690
  readDirectory: (...args) => compilerHost.readDirectory(...args),
@@ -166456,6 +166563,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166456
166563
  return "parameter" /* parameterElement */;
166457
166564
  } else if (symbol.valueDeclaration && isVarConst(symbol.valueDeclaration)) {
166458
166565
  return "const" /* constElement */;
166566
+ } else if (symbol.valueDeclaration && isVarUsing(symbol.valueDeclaration)) {
166567
+ return "using" /* variableUsingElement */;
166568
+ } else if (symbol.valueDeclaration && isVarAwaitUsing(symbol.valueDeclaration)) {
166569
+ return "await using" /* variableAwaitUsingElement */;
166459
166570
  } else if (forEach(symbol.declarations, isLet)) {
166460
166571
  return "let" /* letElement */;
166461
166572
  }
@@ -166849,7 +166960,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166849
166960
  } else {
166850
166961
  addPrefixForAnyFunctionOrVar(symbol, symbolKind);
166851
166962
  }
166852
- if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || isThisExpression) {
166963
+ if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || symbolKind === "using" /* variableUsingElement */ || symbolKind === "await using" /* variableAwaitUsingElement */ || isThisExpression) {
166853
166964
  displayParts.push(punctuationPart(59 /* ColonToken */));
166854
166965
  displayParts.push(spacePart());
166855
166966
  if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) {
@@ -166999,6 +167110,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166999
167110
  case "let" /* letElement */:
167000
167111
  case "const" /* constElement */:
167001
167112
  case "constructor" /* constructorImplementationElement */:
167113
+ case "using" /* variableUsingElement */:
167114
+ case "await using" /* variableAwaitUsingElement */:
167002
167115
  displayParts.push(textOrKeywordPart(symbolKind2));
167003
167116
  return;
167004
167117
  default:
@@ -167813,6 +167926,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
167813
167926
  insertNodeBefore(sourceFile, before, newNode, blankLineBetween = false, options = {}) {
167814
167927
  this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween));
167815
167928
  }
167929
+ insertNodesBefore(sourceFile, before, newNodes, blankLineBetween = false, options = {}) {
167930
+ this.insertNodesAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNodes, this.getOptionsForInsertNodeBefore(before, first(newNodes), blankLineBetween));
167931
+ }
167816
167932
  insertModifierAt(sourceFile, pos, modifier, options = {}) {
167817
167933
  this.insertNodeAt(sourceFile, pos, factory.createToken(modifier), options);
167818
167934
  }
@@ -174453,7 +174569,7 @@ ${options.prefix}` : "\n" : options.prefix
174453
174569
  return this.projectService.includePackageJsonAutoImports();
174454
174570
  }
174455
174571
  /** @internal */
174456
- getModuleResolutionHostForAutoImportProvider() {
174572
+ getHostForAutoImportProvider() {
174457
174573
  var _a, _b;
174458
174574
  if (this.program) {
174459
174575
  return {
@@ -174464,7 +174580,8 @@ ${options.prefix}` : "\n" : options.prefix
174464
174580
  readFile: this.projectService.host.readFile.bind(this.projectService.host),
174465
174581
  getDirectories: this.projectService.host.getDirectories.bind(this.projectService.host),
174466
174582
  trace: (_b = this.projectService.host.trace) == null ? void 0 : _b.bind(this.projectService.host),
174467
- useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames()
174583
+ useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames(),
174584
+ readDirectory: this.projectService.host.readDirectory.bind(this.projectService.host)
174468
174585
  };
174469
174586
  }
174470
174587
  return this.projectService.host;
@@ -174492,7 +174609,7 @@ ${options.prefix}` : "\n" : options.prefix
174492
174609
  if (dependencySelection) {
174493
174610
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider");
174494
174611
  const start = timestamp();
174495
- this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getModuleResolutionHostForAutoImportProvider(), this.documentRegistry);
174612
+ this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry);
174496
174613
  if (this.autoImportProviderHost) {
174497
174614
  updateProjectIfDirty(this.autoImportProviderHost);
174498
174615
  this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start);
@@ -174708,7 +174825,7 @@ ${options.prefix}` : "\n" : options.prefix
174708
174825
  this.getParsedCommandLine = maybeBind(this.hostProject, this.hostProject.getParsedCommandLine);
174709
174826
  }
174710
174827
  /** @internal */
174711
- static getRootFileNames(dependencySelection, hostProject, moduleResolutionHost, compilerOptions) {
174828
+ static getRootFileNames(dependencySelection, hostProject, host, compilerOptions) {
174712
174829
  var _a, _b;
174713
174830
  if (!dependencySelection) {
174714
174831
  return emptyArray;
@@ -174738,7 +174855,7 @@ ${options.prefix}` : "\n" : options.prefix
174738
174855
  name,
174739
174856
  hostProject.currentDirectory,
174740
174857
  compilerOptions,
174741
- moduleResolutionHost,
174858
+ host,
174742
174859
  program.getModuleResolutionCache()
174743
174860
  );
174744
174861
  if (packageJson) {
@@ -174755,7 +174872,7 @@ ${options.prefix}` : "\n" : options.prefix
174755
174872
  `@types/${name}`,
174756
174873
  directory,
174757
174874
  compilerOptions,
174758
- moduleResolutionHost,
174875
+ host,
174759
174876
  program.getModuleResolutionCache()
174760
174877
  );
174761
174878
  if (typesPackageJson) {
@@ -174795,12 +174912,12 @@ ${options.prefix}` : "\n" : options.prefix
174795
174912
  const entrypoints = getEntrypointsFromPackageJsonInfo(
174796
174913
  packageJson,
174797
174914
  compilerOptions,
174798
- moduleResolutionHost,
174915
+ host,
174799
174916
  program2.getModuleResolutionCache(),
174800
174917
  resolveJs
174801
174918
  );
174802
174919
  if (entrypoints) {
174803
- const real = (_a2 = moduleResolutionHost.realpath) == null ? void 0 : _a2.call(moduleResolutionHost, packageJson.packageDirectory);
174920
+ const real = (_a2 = host.realpath) == null ? void 0 : _a2.call(host, packageJson.packageDirectory);
174804
174921
  const isSymlink = real && real !== packageJson.packageDirectory;
174805
174922
  if (isSymlink) {
174806
174923
  symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
@@ -174818,7 +174935,7 @@ ${options.prefix}` : "\n" : options.prefix
174818
174935
  }
174819
174936
  }
174820
174937
  /** @internal */
174821
- static create(dependencySelection, hostProject, moduleResolutionHost, documentRegistry) {
174938
+ static create(dependencySelection, hostProject, host, documentRegistry) {
174822
174939
  if (dependencySelection === 0 /* Off */) {
174823
174940
  return void 0;
174824
174941
  }
@@ -174826,7 +174943,7 @@ ${options.prefix}` : "\n" : options.prefix
174826
174943
  ...hostProject.getCompilerOptions(),
174827
174944
  ...this.compilerOptionsOverrides
174828
174945
  };
174829
- const rootNames = this.getRootFileNames(dependencySelection, hostProject, moduleResolutionHost, compilerOptions);
174946
+ const rootNames = this.getRootFileNames(dependencySelection, hostProject, host, compilerOptions);
174830
174947
  if (!rootNames.length) {
174831
174948
  return void 0;
174832
174949
  }
@@ -174845,7 +174962,7 @@ ${options.prefix}` : "\n" : options.prefix
174845
174962
  rootFileNames = _AutoImportProviderProject.getRootFileNames(
174846
174963
  this.hostProject.includePackageJsonAutoImports(),
174847
174964
  this.hostProject,
174848
- this.hostProject.getModuleResolutionHostForAutoImportProvider(),
174965
+ this.hostProject.getHostForAutoImportProvider(),
174849
174966
  this.getCompilationSettings()
174850
174967
  );
174851
174968
  }
@@ -174884,7 +175001,7 @@ ${options.prefix}` : "\n" : options.prefix
174884
175001
  onPackageJsonChange() {
174885
175002
  throw new Error("package.json changes should be notified on an AutoImportProvider's host project");
174886
175003
  }
174887
- getModuleResolutionHostForAutoImportProvider() {
175004
+ getHostForAutoImportProvider() {
174888
175005
  throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead.");
174889
175006
  }
174890
175007
  getProjectReferences() {