@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 +1 -0
- package/lib/tsc.js +103 -89
- package/lib/tsserver.js +133 -122
- package/lib/tsserverlibrary.d.ts +2 -0
- package/lib/tsserverlibrary.js +133 -122
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +133 -122
- package/lib/typescriptServices.d.ts +1 -0
- package/lib/typescriptServices.js +133 -122
- package/lib/typingsInstaller.js +129 -122
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -6513,7 +6513,7 @@ var ts;
|
|
|
6513
6513
|
*/
|
|
6514
6514
|
/*@internal*/
|
|
6515
6515
|
function createDirectoryWatcherSupportingRecursive(_a) {
|
|
6516
|
-
var watchDirectory = _a.watchDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories,
|
|
6516
|
+
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;
|
|
6517
6517
|
var cache = new ts.Map();
|
|
6518
6518
|
var callbackCache = ts.createMultiMap();
|
|
6519
6519
|
var cacheToUpdateChildWatches = new ts.Map();
|
|
@@ -6613,7 +6613,7 @@ var ts;
|
|
|
6613
6613
|
function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) {
|
|
6614
6614
|
// Iterate through existing children and update the watches if needed
|
|
6615
6615
|
var parentWatcher = cache.get(dirPath);
|
|
6616
|
-
if (parentWatcher &&
|
|
6616
|
+
if (parentWatcher && fileSystemEntryExists(dirName, 1 /* Directory */)) {
|
|
6617
6617
|
// Schedule the update and postpone invoke for callbacks
|
|
6618
6618
|
scheduleUpdateChildWatches(dirName, dirPath, fileName, options);
|
|
6619
6619
|
return;
|
|
@@ -6686,7 +6686,7 @@ var ts;
|
|
|
6686
6686
|
if (!parentWatcher)
|
|
6687
6687
|
return false;
|
|
6688
6688
|
var newChildWatches;
|
|
6689
|
-
var hasChanges = ts.enumerateInsertsAndDeletes(
|
|
6689
|
+
var hasChanges = ts.enumerateInsertsAndDeletes(fileSystemEntryExists(parentDir, 1 /* Directory */) ? ts.mapDefined(getAccessibleSortedChildDirectories(parentDir), function (child) {
|
|
6690
6690
|
var childFullName = ts.getNormalizedAbsolutePath(child, parentDir);
|
|
6691
6691
|
// Filter our the symbolic link directories since those arent included in recursive watch
|
|
6692
6692
|
// which is same behaviour when recursive: true is passed to fs.watch
|
|
@@ -6732,10 +6732,10 @@ var ts;
|
|
|
6732
6732
|
return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); };
|
|
6733
6733
|
}
|
|
6734
6734
|
ts.createFileWatcherCallback = createFileWatcherCallback;
|
|
6735
|
-
function createFsWatchCallbackForFileWatcherCallback(fileName, callback,
|
|
6735
|
+
function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileSystemEntryExists) {
|
|
6736
6736
|
return function (eventName) {
|
|
6737
6737
|
if (eventName === "rename") {
|
|
6738
|
-
callback(fileName,
|
|
6738
|
+
callback(fileName, fileSystemEntryExists(fileName, 0 /* File */) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);
|
|
6739
6739
|
}
|
|
6740
6740
|
else {
|
|
6741
6741
|
// Change
|
|
@@ -6763,11 +6763,12 @@ var ts;
|
|
|
6763
6763
|
}
|
|
6764
6764
|
/*@internal*/
|
|
6765
6765
|
function createSystemWatchFunctions(_a) {
|
|
6766
|
-
var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout,
|
|
6766
|
+
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;
|
|
6767
6767
|
var dynamicPollingWatchFile;
|
|
6768
6768
|
var fixedChunkSizePollingWatchFile;
|
|
6769
6769
|
var nonPollingWatchFile;
|
|
6770
6770
|
var hostRecursiveDirectoryWatcher;
|
|
6771
|
+
var hitSystemWatcherLimit = false;
|
|
6771
6772
|
return {
|
|
6772
6773
|
watchFile: watchFile,
|
|
6773
6774
|
watchDirectory: watchDirectory
|
|
@@ -6785,7 +6786,7 @@ var ts;
|
|
|
6785
6786
|
case ts.WatchFileKind.FixedChunkSizePolling:
|
|
6786
6787
|
return ensureFixedChunkSizePollingWatchFile()(fileName, callback, /* pollingInterval */ undefined, /*options*/ undefined);
|
|
6787
6788
|
case ts.WatchFileKind.UseFsEvents:
|
|
6788
|
-
return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback,
|
|
6789
|
+
return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileSystemEntryExists),
|
|
6789
6790
|
/*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));
|
|
6790
6791
|
case ts.WatchFileKind.UseFsEventsOnParentDirectory:
|
|
6791
6792
|
if (!nonPollingWatchFile) {
|
|
@@ -6846,7 +6847,7 @@ var ts;
|
|
|
6846
6847
|
hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({
|
|
6847
6848
|
useCaseSensitiveFileNames: useCaseSensitiveFileNames,
|
|
6848
6849
|
getCurrentDirectory: getCurrentDirectory,
|
|
6849
|
-
|
|
6850
|
+
fileSystemEntryExists: fileSystemEntryExists,
|
|
6850
6851
|
getAccessibleSortedChildDirectories: getAccessibleSortedChildDirectories,
|
|
6851
6852
|
watchDirectory: nonRecursiveWatchDirectory,
|
|
6852
6853
|
realpath: realpath,
|
|
@@ -6897,6 +6898,114 @@ var ts;
|
|
|
6897
6898
|
};
|
|
6898
6899
|
}
|
|
6899
6900
|
}
|
|
6901
|
+
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
6902
|
+
var lastDirectoryPartWithDirectorySeparator;
|
|
6903
|
+
var lastDirectoryPart;
|
|
6904
|
+
if (inodeWatching) {
|
|
6905
|
+
lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substring(fileOrDirectory.lastIndexOf(ts.directorySeparator));
|
|
6906
|
+
lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(ts.directorySeparator.length);
|
|
6907
|
+
}
|
|
6908
|
+
/** Watcher for the file system entry depending on whether it is missing or present */
|
|
6909
|
+
var watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ?
|
|
6910
|
+
watchMissingFileSystemEntry() :
|
|
6911
|
+
watchPresentFileSystemEntry();
|
|
6912
|
+
return {
|
|
6913
|
+
close: function () {
|
|
6914
|
+
// Close the watcher (either existing file system entry watcher or missing file system entry watcher)
|
|
6915
|
+
watcher.close();
|
|
6916
|
+
watcher = undefined;
|
|
6917
|
+
}
|
|
6918
|
+
};
|
|
6919
|
+
function updateWatcher(createWatcher) {
|
|
6920
|
+
// If watcher is not closed, update it
|
|
6921
|
+
if (watcher) {
|
|
6922
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
6923
|
+
watcher.close();
|
|
6924
|
+
watcher = createWatcher();
|
|
6925
|
+
}
|
|
6926
|
+
}
|
|
6927
|
+
/**
|
|
6928
|
+
* Watch the file or directory that is currently present
|
|
6929
|
+
* and when the watched file or directory is deleted, switch to missing file system entry watcher
|
|
6930
|
+
*/
|
|
6931
|
+
function watchPresentFileSystemEntry() {
|
|
6932
|
+
if (hitSystemWatcherLimit) {
|
|
6933
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to watchFile");
|
|
6934
|
+
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
6935
|
+
}
|
|
6936
|
+
try {
|
|
6937
|
+
var presentWatcher = fsWatchWorker(fileOrDirectory, recursive, inodeWatching ?
|
|
6938
|
+
callbackChangingToMissingFileSystemEntry :
|
|
6939
|
+
function (eventName, relativeFileName) {
|
|
6940
|
+
sysLog("sysLog:: watchPresentFileSystemEntry:: " + fileOrDirectory + " " + entryKind + " " + eventName + ":: " + relativeFileName);
|
|
6941
|
+
callback(eventName, relativeFileName);
|
|
6942
|
+
});
|
|
6943
|
+
// Watch the missing file or directory or error
|
|
6944
|
+
presentWatcher.on("error", function () {
|
|
6945
|
+
sysLog("sysLog:: watchPresentFileSystemEntry:: on Error " + fileOrDirectory + " " + entryKind + " rename, \"\"");
|
|
6946
|
+
callback("rename", "");
|
|
6947
|
+
updateWatcher(watchMissingFileSystemEntry);
|
|
6948
|
+
});
|
|
6949
|
+
return presentWatcher;
|
|
6950
|
+
}
|
|
6951
|
+
catch (e) {
|
|
6952
|
+
// Catch the exception and use polling instead
|
|
6953
|
+
// Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
|
|
6954
|
+
// so instead of throwing error, use fs.watchFile
|
|
6955
|
+
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
6956
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to watchFile");
|
|
6957
|
+
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
6958
|
+
}
|
|
6959
|
+
}
|
|
6960
|
+
function callbackChangingToMissingFileSystemEntry(event, relativeName) {
|
|
6961
|
+
sysLog("sysLog:: callbackChangingToMissingFileSystemEntry:: " + fileOrDirectory + " " + entryKind + " " + event + ":: " + relativeName + " " + inodeWatching + " " + lastDirectoryPart + " " + lastDirectoryPartWithDirectorySeparator);
|
|
6962
|
+
if (relativeName && ts.endsWith(relativeName, "~")) {
|
|
6963
|
+
relativeName = relativeName.slice(0, relativeName.length - 1);
|
|
6964
|
+
sysLog("sysLog:: callbackChangingToMissingFileSystemEntry:: changed the relative name to " + relativeName);
|
|
6965
|
+
}
|
|
6966
|
+
callback(event, relativeName);
|
|
6967
|
+
// because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
|
|
6968
|
+
// Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
|
|
6969
|
+
if (event === "rename" &&
|
|
6970
|
+
(!relativeName ||
|
|
6971
|
+
relativeName === lastDirectoryPart ||
|
|
6972
|
+
ts.endsWith(relativeName, lastDirectoryPartWithDirectorySeparator))) {
|
|
6973
|
+
if (inodeWatching) {
|
|
6974
|
+
updateWatcher(!fileSystemEntryExists(fileOrDirectory, entryKind) ? watchMissingFileSystemEntry : watchPresentFileSystemEntry);
|
|
6975
|
+
}
|
|
6976
|
+
else if (!fileSystemEntryExists(fileOrDirectory, entryKind)) {
|
|
6977
|
+
updateWatcher(watchMissingFileSystemEntry);
|
|
6978
|
+
}
|
|
6979
|
+
}
|
|
6980
|
+
}
|
|
6981
|
+
/**
|
|
6982
|
+
* Watch the file or directory using fs.watchFile since fs.watch threw exception
|
|
6983
|
+
* Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
|
|
6984
|
+
*/
|
|
6985
|
+
function watchPresentFileSystemEntryWithFsWatchFile() {
|
|
6986
|
+
return watchFile(fileOrDirectory, createFileWatcherCallback(function (eventName, relativeFileName) {
|
|
6987
|
+
sysLog("sysLog:: watchPresentFileSystemEntryWithFsWatchFile:: " + fileOrDirectory + " " + entryKind + " " + eventName + ":: " + relativeFileName);
|
|
6988
|
+
callback(eventName, relativeFileName);
|
|
6989
|
+
}), fallbackPollingInterval, fallbackOptions);
|
|
6990
|
+
}
|
|
6991
|
+
/**
|
|
6992
|
+
* Watch the file or directory that is missing
|
|
6993
|
+
* and switch to existing file or directory when the missing filesystem entry is created
|
|
6994
|
+
*/
|
|
6995
|
+
function watchMissingFileSystemEntry() {
|
|
6996
|
+
return watchFile(fileOrDirectory, function (_fileName, eventKind) {
|
|
6997
|
+
sysLog("sysLog:: watchMissingFileSystemEntry:: " + fileOrDirectory + " " + entryKind + " " + _fileName + ":: " + eventKind);
|
|
6998
|
+
if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
|
|
6999
|
+
sysLog("sysLog:: watchMissingFileSystemEntry:: Callback :: rename, \"\" and will update the watcher");
|
|
7000
|
+
callback("rename", "");
|
|
7001
|
+
// Call the callback for current file or directory
|
|
7002
|
+
// For now it could be callback for the inner directory creation,
|
|
7003
|
+
// but just return current directory, better than current no-op
|
|
7004
|
+
updateWatcher(watchPresentFileSystemEntry);
|
|
7005
|
+
}
|
|
7006
|
+
}, fallbackPollingInterval, fallbackOptions);
|
|
7007
|
+
}
|
|
7008
|
+
}
|
|
6900
7009
|
}
|
|
6901
7010
|
ts.createSystemWatchFunctions = createSystemWatchFunctions;
|
|
6902
7011
|
/**
|
|
@@ -6949,7 +7058,6 @@ var ts;
|
|
|
6949
7058
|
}
|
|
6950
7059
|
var activeSession;
|
|
6951
7060
|
var profilePath = "./profile.cpuprofile";
|
|
6952
|
-
var hitSystemWatcherLimit = false;
|
|
6953
7061
|
var Buffer = require("buffer").Buffer;
|
|
6954
7062
|
var nodeVersion = getNodeMajorVersion();
|
|
6955
7063
|
var isNode4OrLater = nodeVersion >= 4;
|
|
@@ -6964,20 +7072,21 @@ var ts;
|
|
|
6964
7072
|
getModifiedTime: getModifiedTime,
|
|
6965
7073
|
setTimeout: setTimeout,
|
|
6966
7074
|
clearTimeout: clearTimeout,
|
|
6967
|
-
|
|
7075
|
+
fsWatchWorker: fsWatchWorker,
|
|
6968
7076
|
useCaseSensitiveFileNames: useCaseSensitiveFileNames,
|
|
6969
7077
|
getCurrentDirectory: getCurrentDirectory,
|
|
6970
|
-
|
|
7078
|
+
fileSystemEntryExists: fileSystemEntryExists,
|
|
6971
7079
|
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
|
|
6972
7080
|
// (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
|
|
6973
7081
|
fsSupportsRecursiveFsWatch: fsSupportsRecursiveFsWatch,
|
|
6974
|
-
directoryExists: directoryExists,
|
|
6975
7082
|
getAccessibleSortedChildDirectories: function (path) { return getAccessibleFileSystemEntries(path).directories; },
|
|
6976
7083
|
realpath: realpath,
|
|
6977
7084
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
6978
7085
|
useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
|
|
6979
7086
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
6980
7087
|
defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
|
|
7088
|
+
inodeWatching: isLinuxOrMacOs,
|
|
7089
|
+
sysLog: sysLog,
|
|
6981
7090
|
}), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory;
|
|
6982
7091
|
var nodeSystem = {
|
|
6983
7092
|
args: process.argv.slice(2),
|
|
@@ -7230,107 +7339,11 @@ var ts;
|
|
|
7230
7339
|
callback(fileName, eventKind);
|
|
7231
7340
|
}
|
|
7232
7341
|
}
|
|
7233
|
-
function
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substr(fileOrDirectory.lastIndexOf(ts.directorySeparator));
|
|
7239
|
-
lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(ts.directorySeparator.length);
|
|
7240
|
-
}
|
|
7241
|
-
/** Watcher for the file system entry depending on whether it is missing or present */
|
|
7242
|
-
var watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ?
|
|
7243
|
-
watchMissingFileSystemEntry() :
|
|
7244
|
-
watchPresentFileSystemEntry();
|
|
7245
|
-
return {
|
|
7246
|
-
close: function () {
|
|
7247
|
-
// Close the watcher (either existing file system entry watcher or missing file system entry watcher)
|
|
7248
|
-
watcher.close();
|
|
7249
|
-
watcher = undefined;
|
|
7250
|
-
}
|
|
7251
|
-
};
|
|
7252
|
-
/**
|
|
7253
|
-
* Invoke the callback with rename and update the watcher if not closed
|
|
7254
|
-
* @param createWatcher
|
|
7255
|
-
*/
|
|
7256
|
-
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
7257
|
-
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
7258
|
-
// Call the callback for current directory
|
|
7259
|
-
callback("rename", "");
|
|
7260
|
-
// If watcher is not closed, update it
|
|
7261
|
-
if (watcher) {
|
|
7262
|
-
watcher.close();
|
|
7263
|
-
watcher = createWatcher();
|
|
7264
|
-
}
|
|
7265
|
-
}
|
|
7266
|
-
/**
|
|
7267
|
-
* Watch the file or directory that is currently present
|
|
7268
|
-
* and when the watched file or directory is deleted, switch to missing file system entry watcher
|
|
7269
|
-
*/
|
|
7270
|
-
function watchPresentFileSystemEntry() {
|
|
7271
|
-
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
|
|
7272
|
-
// (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
|
|
7273
|
-
if (options === undefined) {
|
|
7274
|
-
if (fsSupportsRecursiveFsWatch) {
|
|
7275
|
-
options = { persistent: true, recursive: !!recursive };
|
|
7276
|
-
}
|
|
7277
|
-
else {
|
|
7278
|
-
options = { persistent: true };
|
|
7279
|
-
}
|
|
7280
|
-
}
|
|
7281
|
-
if (hitSystemWatcherLimit) {
|
|
7282
|
-
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
|
|
7283
|
-
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7284
|
-
}
|
|
7285
|
-
try {
|
|
7286
|
-
var presentWatcher = _fs.watch(fileOrDirectory, options, isLinuxOrMacOs ?
|
|
7287
|
-
callbackChangingToMissingFileSystemEntry :
|
|
7288
|
-
callback);
|
|
7289
|
-
// Watch the missing file or directory or error
|
|
7290
|
-
presentWatcher.on("error", function () { return invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry); });
|
|
7291
|
-
return presentWatcher;
|
|
7292
|
-
}
|
|
7293
|
-
catch (e) {
|
|
7294
|
-
// Catch the exception and use polling instead
|
|
7295
|
-
// Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
|
|
7296
|
-
// so instead of throwing error, use fs.watchFile
|
|
7297
|
-
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
7298
|
-
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
|
|
7299
|
-
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7300
|
-
}
|
|
7301
|
-
}
|
|
7302
|
-
function callbackChangingToMissingFileSystemEntry(event, relativeName) {
|
|
7303
|
-
// because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
|
|
7304
|
-
// Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
|
|
7305
|
-
return event === "rename" &&
|
|
7306
|
-
(!relativeName ||
|
|
7307
|
-
relativeName === lastDirectoryPart ||
|
|
7308
|
-
(relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) !== -1 && relativeName.lastIndexOf(lastDirectoryPartWithDirectorySeparator) === relativeName.length - lastDirectoryPartWithDirectorySeparator.length)) &&
|
|
7309
|
-
!fileSystemEntryExists(fileOrDirectory, entryKind) ?
|
|
7310
|
-
invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry) :
|
|
7311
|
-
callback(event, relativeName);
|
|
7312
|
-
}
|
|
7313
|
-
/**
|
|
7314
|
-
* Watch the file or directory using fs.watchFile since fs.watch threw exception
|
|
7315
|
-
* Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
|
|
7316
|
-
*/
|
|
7317
|
-
function watchPresentFileSystemEntryWithFsWatchFile() {
|
|
7318
|
-
return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions);
|
|
7319
|
-
}
|
|
7320
|
-
/**
|
|
7321
|
-
* Watch the file or directory that is missing
|
|
7322
|
-
* and switch to existing file or directory when the missing filesystem entry is created
|
|
7323
|
-
*/
|
|
7324
|
-
function watchMissingFileSystemEntry() {
|
|
7325
|
-
return watchFile(fileOrDirectory, function (_fileName, eventKind) {
|
|
7326
|
-
if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
|
|
7327
|
-
// Call the callback for current file or directory
|
|
7328
|
-
// For now it could be callback for the inner directory creation,
|
|
7329
|
-
// but just return current directory, better than current no-op
|
|
7330
|
-
invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry);
|
|
7331
|
-
}
|
|
7332
|
-
}, fallbackPollingInterval, fallbackOptions);
|
|
7333
|
-
}
|
|
7342
|
+
function fsWatchWorker(fileOrDirectory, recursive, callback) {
|
|
7343
|
+
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
|
|
7344
|
+
// (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
|
|
7345
|
+
return _fs.watch(fileOrDirectory, fsSupportsRecursiveFsWatch ?
|
|
7346
|
+
{ persistent: true, recursive: !!recursive } : { persistent: true }, callback);
|
|
7334
7347
|
}
|
|
7335
7348
|
function readFileWorker(fileName, _encoding) {
|
|
7336
7349
|
var buffer;
|
|
@@ -42237,7 +42250,7 @@ var ts;
|
|
|
42237
42250
|
}
|
|
42238
42251
|
if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
|
|
42239
42252
|
return {
|
|
42240
|
-
key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
|
|
42253
|
+
key: ts.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec)),
|
|
42241
42254
|
flags: 1 /* Recursive */
|
|
42242
42255
|
};
|
|
42243
42256
|
}
|
|
@@ -78627,11 +78640,6 @@ var ts;
|
|
|
78627
78640
|
ts.every(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
|
|
78628
78641
|
isTypeAssignableToKind(source, kind, strict);
|
|
78629
78642
|
}
|
|
78630
|
-
function anyTypesAssignableToKind(source, kind, strict) {
|
|
78631
|
-
return source.flags & 1048576 /* Union */ ?
|
|
78632
|
-
ts.some(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
|
|
78633
|
-
isTypeAssignableToKind(source, kind, strict);
|
|
78634
|
-
}
|
|
78635
78643
|
function isConstEnumObjectType(type) {
|
|
78636
78644
|
return !!(ts.getObjectFlags(type) & 16 /* Anonymous */) && !!type.symbol && isConstEnumSymbol(type.symbol);
|
|
78637
78645
|
}
|
|
@@ -83012,9 +83020,7 @@ var ts;
|
|
|
83012
83020
|
}
|
|
83013
83021
|
// unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved
|
|
83014
83022
|
// in this case error about missing name is already reported - do not report extra one
|
|
83015
|
-
|
|
83016
|
-
// `getNonNullableTypeIfNeeded` is a noop (and the nullable types as any-ish).
|
|
83017
|
-
if (!isTypeAny(rightType) && !(rightType.flags & 98304 /* Nullable */) && anyTypesAssignableToKind(getBaseConstraintOrType(rightType), (131068 /* Primitive */ | 131072 /* Never */) & ~98304 /* Nullable */)) {
|
|
83023
|
+
if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) {
|
|
83018
83024
|
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));
|
|
83019
83025
|
}
|
|
83020
83026
|
checkSourceElement(node.statement);
|
|
@@ -123848,6 +123854,7 @@ var ts;
|
|
|
123848
123854
|
}
|
|
123849
123855
|
function reloadFileNamesFromConfigFile() {
|
|
123850
123856
|
writeLog("Reloading new file names and options");
|
|
123857
|
+
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
123851
123858
|
rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
123852
123859
|
if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
123853
123860
|
hasChangedConfigFileParsingErrors = true;
|
|
@@ -144583,6 +144590,10 @@ var ts;
|
|
|
144583
144590
|
}
|
|
144584
144591
|
var typeDisplayString = printTypeInSingleLine(declarationType);
|
|
144585
144592
|
if (typeDisplayString) {
|
|
144593
|
+
var isVariableNameMatchesType = preferences.includeInlayVariableTypeHintsWhenTypeMatchesName === false && ts.equateStringsCaseInsensitive(decl.name.getText(), typeDisplayString);
|
|
144594
|
+
if (isVariableNameMatchesType) {
|
|
144595
|
+
return;
|
|
144596
|
+
}
|
|
144586
144597
|
addTypeHints(typeDisplayString, decl.name.end);
|
|
144587
144598
|
}
|
|
144588
144599
|
}
|
package/lib/typescript.d.ts
CHANGED
|
@@ -4120,6 +4120,7 @@ declare namespace ts {
|
|
|
4120
4120
|
readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
|
|
4121
4121
|
readonly includeInlayFunctionParameterTypeHints?: boolean;
|
|
4122
4122
|
readonly includeInlayVariableTypeHints?: boolean;
|
|
4123
|
+
readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
|
|
4123
4124
|
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
|
4124
4125
|
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
|
4125
4126
|
readonly includeInlayEnumMemberValueHints?: boolean;
|