@typescript-deploys/pr-build 4.8.0-pr-49245-7 → 4.8.0-pr-48997-21

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/protocol.d.ts CHANGED
@@ -2699,6 +2699,7 @@ declare namespace ts.server.protocol {
2699
2699
  readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
2700
2700
  readonly includeInlayFunctionParameterTypeHints?: boolean;
2701
2701
  readonly includeInlayVariableTypeHints?: boolean;
2702
+ readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
2702
2703
  readonly includeInlayPropertyDeclarationTypeHints?: boolean;
2703
2704
  readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
2704
2705
  readonly includeInlayEnumMemberValueHints?: boolean;
package/lib/tsc.js CHANGED
@@ -3855,7 +3855,7 @@ var ts;
3855
3855
  }
3856
3856
  ts.setSysLog = setSysLog;
3857
3857
  function createDirectoryWatcherSupportingRecursive(_a) {
3858
- var watchDirectory = _a.watchDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, directoryExists = _a.directoryExists, realpath = _a.realpath, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout;
3858
+ var watchDirectory = _a.watchDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, fileSystemEntryExists = _a.fileSystemEntryExists, realpath = _a.realpath, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout;
3859
3859
  var cache = new ts.Map();
3860
3860
  var callbackCache = ts.createMultiMap();
3861
3861
  var cacheToUpdateChildWatches = new ts.Map();
@@ -3948,7 +3948,7 @@ var ts;
3948
3948
  }
3949
3949
  function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) {
3950
3950
  var parentWatcher = cache.get(dirPath);
3951
- if (parentWatcher && directoryExists(dirName)) {
3951
+ if (parentWatcher && fileSystemEntryExists(dirName, 1)) {
3952
3952
  scheduleUpdateChildWatches(dirName, dirPath, fileName, options);
3953
3953
  return;
3954
3954
  }
@@ -4016,7 +4016,7 @@ var ts;
4016
4016
  if (!parentWatcher)
4017
4017
  return false;
4018
4018
  var newChildWatches;
4019
- var hasChanges = ts.enumerateInsertsAndDeletes(directoryExists(parentDir) ? ts.mapDefined(getAccessibleSortedChildDirectories(parentDir), function (child) {
4019
+ var hasChanges = ts.enumerateInsertsAndDeletes(fileSystemEntryExists(parentDir, 1) ? ts.mapDefined(getAccessibleSortedChildDirectories(parentDir), function (child) {
4020
4020
  var childFullName = ts.getNormalizedAbsolutePath(child, parentDir);
4021
4021
  return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, ts.normalizePath(realpath(childFullName))) === 0 ? childFullName : undefined;
4022
4022
  }) : ts.emptyArray, parentWatcher.childWatches, function (child, childWatcher) { return filePathComparer(child, childWatcher.dirName); }, createAndAddChildDirectoryWatcher, ts.closeFileWatcher, addChildDirectoryWatcher);
@@ -4047,10 +4047,10 @@ var ts;
4047
4047
  return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
4048
4048
  }
4049
4049
  ts.createFileWatcherCallback = createFileWatcherCallback;
4050
- function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {
4050
+ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileSystemEntryExists) {
4051
4051
  return function (eventName) {
4052
4052
  if (eventName === "rename") {
4053
- callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
4053
+ callback(fileName, fileSystemEntryExists(fileName, 0) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
4054
4054
  }
4055
4055
  else {
4056
4056
  callback(fileName, FileWatcherEventKind.Changed);
@@ -4072,11 +4072,12 @@ var ts;
4072
4072
  };
4073
4073
  }
4074
4074
  function createSystemWatchFunctions(_a) {
4075
- var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatch = _a.fsWatch, fileExists = _a.fileExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, directoryExists = _a.directoryExists, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind;
4075
+ var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatchWorker = _a.fsWatchWorker, fileSystemEntryExists = _a.fileSystemEntryExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind, inodeWatching = _a.inodeWatching, sysLog = _a.sysLog;
4076
4076
  var dynamicPollingWatchFile;
4077
4077
  var fixedChunkSizePollingWatchFile;
4078
4078
  var nonPollingWatchFile;
4079
4079
  var hostRecursiveDirectoryWatcher;
4080
+ var hitSystemWatcherLimit = false;
4080
4081
  return {
4081
4082
  watchFile: watchFile,
4082
4083
  watchDirectory: watchDirectory
@@ -4094,7 +4095,7 @@ var ts;
4094
4095
  case ts.WatchFileKind.FixedChunkSizePolling:
4095
4096
  return ensureFixedChunkSizePollingWatchFile()(fileName, callback, undefined, undefined);
4096
4097
  case ts.WatchFileKind.UseFsEvents:
4097
- return fsWatch(fileName, 0, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists), false, pollingInterval, ts.getFallbackOptions(options));
4098
+ return fsWatch(fileName, 0, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileSystemEntryExists), false, pollingInterval, ts.getFallbackOptions(options));
4098
4099
  case ts.WatchFileKind.UseFsEventsOnParentDirectory:
4099
4100
  if (!nonPollingWatchFile) {
4100
4101
  nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames);
@@ -4147,7 +4148,7 @@ var ts;
4147
4148
  hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({
4148
4149
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
4149
4150
  getCurrentDirectory: getCurrentDirectory,
4150
- directoryExists: directoryExists,
4151
+ fileSystemEntryExists: fileSystemEntryExists,
4151
4152
  getAccessibleSortedChildDirectories: getAccessibleSortedChildDirectories,
4152
4153
  watchDirectory: nonRecursiveWatchDirectory,
4153
4154
  realpath: realpath,
@@ -4192,6 +4193,90 @@ var ts;
4192
4193
  };
4193
4194
  }
4194
4195
  }
4196
+ function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
4197
+ var lastDirectoryPartWithDirectorySeparator;
4198
+ var lastDirectoryPart;
4199
+ if (inodeWatching) {
4200
+ lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substring(fileOrDirectory.lastIndexOf(ts.directorySeparator));
4201
+ lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(ts.directorySeparator.length);
4202
+ }
4203
+ var watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ?
4204
+ watchMissingFileSystemEntry() :
4205
+ watchPresentFileSystemEntry();
4206
+ return {
4207
+ close: function () {
4208
+ watcher.close();
4209
+ watcher = undefined;
4210
+ }
4211
+ };
4212
+ function updateWatcher(createWatcher) {
4213
+ if (watcher) {
4214
+ sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
4215
+ watcher.close();
4216
+ watcher = createWatcher();
4217
+ }
4218
+ }
4219
+ function watchPresentFileSystemEntry() {
4220
+ if (hitSystemWatcherLimit) {
4221
+ sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to watchFile");
4222
+ return watchPresentFileSystemEntryWithFsWatchFile();
4223
+ }
4224
+ try {
4225
+ var presentWatcher = fsWatchWorker(fileOrDirectory, recursive, inodeWatching ?
4226
+ callbackChangingToMissingFileSystemEntry :
4227
+ function (eventName, relativeFileName) {
4228
+ sysLog("sysLog:: watchPresentFileSystemEntry:: " + fileOrDirectory + " " + entryKind + " " + eventName + ":: " + relativeFileName);
4229
+ callback(eventName, relativeFileName);
4230
+ });
4231
+ presentWatcher.on("error", function () {
4232
+ sysLog("sysLog:: watchPresentFileSystemEntry:: on Error " + fileOrDirectory + " " + entryKind + " rename, \"\"");
4233
+ callback("rename", "");
4234
+ updateWatcher(watchMissingFileSystemEntry);
4235
+ });
4236
+ return presentWatcher;
4237
+ }
4238
+ catch (e) {
4239
+ hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
4240
+ sysLog("sysLog:: " + fileOrDirectory + ":: Changing to watchFile");
4241
+ return watchPresentFileSystemEntryWithFsWatchFile();
4242
+ }
4243
+ }
4244
+ function callbackChangingToMissingFileSystemEntry(event, relativeName) {
4245
+ sysLog("sysLog:: callbackChangingToMissingFileSystemEntry:: " + fileOrDirectory + " " + entryKind + " " + event + ":: " + relativeName + " " + inodeWatching + " " + lastDirectoryPart + " " + lastDirectoryPartWithDirectorySeparator);
4246
+ if (relativeName && ts.endsWith(relativeName, "~")) {
4247
+ relativeName = relativeName.slice(0, relativeName.length - 1);
4248
+ sysLog("sysLog:: callbackChangingToMissingFileSystemEntry:: changed the relative name to " + relativeName);
4249
+ }
4250
+ callback(event, relativeName);
4251
+ if (event === "rename" &&
4252
+ (!relativeName ||
4253
+ relativeName === lastDirectoryPart ||
4254
+ ts.endsWith(relativeName, lastDirectoryPartWithDirectorySeparator))) {
4255
+ if (inodeWatching) {
4256
+ updateWatcher(!fileSystemEntryExists(fileOrDirectory, entryKind) ? watchMissingFileSystemEntry : watchPresentFileSystemEntry);
4257
+ }
4258
+ else if (!fileSystemEntryExists(fileOrDirectory, entryKind)) {
4259
+ updateWatcher(watchMissingFileSystemEntry);
4260
+ }
4261
+ }
4262
+ }
4263
+ function watchPresentFileSystemEntryWithFsWatchFile() {
4264
+ return watchFile(fileOrDirectory, createFileWatcherCallback(function (eventName, relativeFileName) {
4265
+ sysLog("sysLog:: watchPresentFileSystemEntryWithFsWatchFile:: " + fileOrDirectory + " " + entryKind + " " + eventName + ":: " + relativeFileName);
4266
+ callback(eventName, relativeFileName);
4267
+ }), fallbackPollingInterval, fallbackOptions);
4268
+ }
4269
+ function watchMissingFileSystemEntry() {
4270
+ return watchFile(fileOrDirectory, function (_fileName, eventKind) {
4271
+ sysLog("sysLog:: watchMissingFileSystemEntry:: " + fileOrDirectory + " " + entryKind + " " + _fileName + ":: " + eventKind);
4272
+ if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
4273
+ sysLog("sysLog:: watchMissingFileSystemEntry:: Callback :: rename, \"\" and will update the watcher");
4274
+ callback("rename", "");
4275
+ updateWatcher(watchPresentFileSystemEntry);
4276
+ }
4277
+ }, fallbackPollingInterval, fallbackOptions);
4278
+ }
4279
+ }
4195
4280
  }
4196
4281
  ts.createSystemWatchFunctions = createSystemWatchFunctions;
4197
4282
  function patchWriteFileEnsuringDirectory(sys) {
@@ -4233,7 +4318,6 @@ var ts;
4233
4318
  }
4234
4319
  var activeSession;
4235
4320
  var profilePath = "./profile.cpuprofile";
4236
- var hitSystemWatcherLimit = false;
4237
4321
  var Buffer = require("buffer").Buffer;
4238
4322
  var nodeVersion = getNodeMajorVersion();
4239
4323
  var isNode4OrLater = nodeVersion >= 4;
@@ -4248,18 +4332,19 @@ var ts;
4248
4332
  getModifiedTime: getModifiedTime,
4249
4333
  setTimeout: setTimeout,
4250
4334
  clearTimeout: clearTimeout,
4251
- fsWatch: fsWatch,
4335
+ fsWatchWorker: fsWatchWorker,
4252
4336
  useCaseSensitiveFileNames: useCaseSensitiveFileNames,
4253
4337
  getCurrentDirectory: getCurrentDirectory,
4254
- fileExists: fileExists,
4338
+ fileSystemEntryExists: fileSystemEntryExists,
4255
4339
  fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
4256
- directoryExists: directoryExists,
4257
4340
  getAccessibleSortedChildDirectories: function (path) { return getAccessibleFileSystemEntries(path).directories; },
4258
4341
  realpath: realpath,
4259
4342
  tscWatchFile: process.env.TSC_WATCHFILE,
4260
4343
  useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
4261
4344
  tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
4262
4345
  defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
4346
+ inodeWatching: isLinuxOrMacOs,
4347
+ sysLog: sysLog,
4263
4348
  }), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory;
4264
4349
  var nodeSystem = {
4265
4350
  args: process.argv.slice(2),
@@ -4482,76 +4567,9 @@ var ts;
4482
4567
  callback(fileName, eventKind);
4483
4568
  }
4484
4569
  }
4485
- function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
4486
- var options;
4487
- var lastDirectoryPartWithDirectorySeparator;
4488
- var lastDirectoryPart;
4489
- if (isLinuxOrMacOs) {
4490
- lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substr(fileOrDirectory.lastIndexOf(ts.directorySeparator));
4491
- lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(ts.directorySeparator.length);
4492
- }
4493
- var watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ?
4494
- watchMissingFileSystemEntry() :
4495
- watchPresentFileSystemEntry();
4496
- return {
4497
- close: function () {
4498
- watcher.close();
4499
- watcher = undefined;
4500
- }
4501
- };
4502
- function invokeCallbackAndUpdateWatcher(createWatcher) {
4503
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
4504
- callback("rename", "");
4505
- if (watcher) {
4506
- watcher.close();
4507
- watcher = createWatcher();
4508
- }
4509
- }
4510
- function watchPresentFileSystemEntry() {
4511
- if (options === undefined) {
4512
- if (fsSupportsRecursiveFsWatch) {
4513
- options = { persistent: true, recursive: !!recursive };
4514
- }
4515
- else {
4516
- options = { persistent: true };
4517
- }
4518
- }
4519
- if (hitSystemWatcherLimit) {
4520
- sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
4521
- return watchPresentFileSystemEntryWithFsWatchFile();
4522
- }
4523
- try {
4524
- var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
4525
- callbackChangingToMissingFileSystemEntry :
4526
- callback);
4527
- presentWatcher.on("error", function () { return invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry); });
4528
- return presentWatcher;
4529
- }
4530
- catch (e) {
4531
- hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
4532
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
4533
- return watchPresentFileSystemEntryWithFsWatchFile();
4534
- }
4535
- }
4536
- function callbackChangingToMissingFileSystemEntry(event, relativeName) {
4537
- return event === "rename" &&
4538
- (!relativeName ||
4539
- relativeName === lastDirectoryPart ||
4540
- (relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
4541
- !fileSystemEntryExists(fileOrDirectory, entryKind) ?
4542
- invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
4543
- callback(event, relativeName);
4544
- }
4545
- function watchPresentFileSystemEntryWithFsWatchFile() {
4546
- return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
4547
- }
4548
- function watchMissingFileSystemEntry() {
4549
- return watchFile(fileOrDirectory, function (_fileName, eventKind) {
4550
- if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
4551
- invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
4552
- }
4553
- }, fallbackPollingInterval, fallbackOptions);
4554
- }
4570
+ function fsWatchWorker(fileOrDirectory, recursive, callback) {
4571
+ return _fs.watch(fileOrDirectory, fsSupportsRecursiveFsWatch ?
4572
+ { persistent: true, recursive: !!recursive } : { persistent: true }, callback);
4555
4573
  }
4556
4574
  function readFileWorker(fileName, _encoding) {
4557
4575
  var buffer;
@@ -34266,7 +34284,7 @@ var ts;
34266
34284
  }
34267
34285
  if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
34268
34286
  return {
34269
- key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
34287
+ key: ts.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec)),
34270
34288
  flags: 1
34271
34289
  };
34272
34290
  }
@@ -65616,11 +65634,6 @@ var ts;
65616
65634
  ts.every(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
65617
65635
  isTypeAssignableToKind(source, kind, strict);
65618
65636
  }
65619
- function anyTypesAssignableToKind(source, kind, strict) {
65620
- return source.flags & 1048576 ?
65621
- ts.some(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
65622
- isTypeAssignableToKind(source, kind, strict);
65623
- }
65624
65637
  function isConstEnumObjectType(type) {
65625
65638
  return !!(ts.getObjectFlags(type) & 16) && !!type.symbol && isConstEnumSymbol(type.symbol);
65626
65639
  }
@@ -69383,7 +69396,7 @@ var ts;
69383
69396
  checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access);
69384
69397
  }
69385
69398
  }
69386
- if (!isTypeAny(rightType) && !(rightType.flags & 98304) && anyTypesAssignableToKind(getBaseConstraintOrType(rightType), (131068 | 131072) & ~98304)) {
69399
+ if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 | 58982400)) {
69387
69400
  error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType));
69388
69401
  }
69389
69402
  checkSourceElement(node.statement);
@@ -102350,6 +102363,7 @@ var ts;
102350
102363
  }
102351
102364
  function reloadFileNamesFromConfigFile() {
102352
102365
  writeLog("Reloading new file names and options");
102366
+ reloadLevel = ts.ConfigFileProgramReloadLevel.None;
102353
102367
  rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
102354
102368
  if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
102355
102369
  hasChangedConfigFileParsingErrors = true;