typescript 4.9.0-dev.20220905 → 4.9.0-dev.20220909
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/tsc.js +40 -39
- package/lib/tsserver.js +48 -60
- package/lib/tsserverlibrary.js +48 -46
- package/lib/typescript.js +48 -46
- package/lib/typescriptServices.js +48 -46
- package/lib/typingsInstaller.js +44 -45
- package/package.json +2 -4
package/lib/tsserverlibrary.js
CHANGED
|
@@ -108,7 +108,7 @@ var ts;
|
|
|
108
108
|
// The following is baselined as a literal template type without intervention
|
|
109
109
|
/** The version of the TypeScript compiler release */
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
111
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220909");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -6146,7 +6146,6 @@ var ts;
|
|
|
6146
6146
|
var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
6147
6147
|
/* @internal */
|
|
6148
6148
|
ts.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
6149
|
-
/* @internal */
|
|
6150
6149
|
function setCustomPollingValues(system) {
|
|
6151
6150
|
if (!system.getEnvironmentVariable) {
|
|
6152
6151
|
return;
|
|
@@ -6189,7 +6188,6 @@ var ts;
|
|
|
6189
6188
|
createPollingIntervalBasedLevels(customLevels ? __assign(__assign({}, defaultLevels), customLevels) : defaultLevels);
|
|
6190
6189
|
}
|
|
6191
6190
|
}
|
|
6192
|
-
ts.setCustomPollingValues = setCustomPollingValues;
|
|
6193
6191
|
function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) {
|
|
6194
6192
|
var definedValueCopyToIndex = pollIndex;
|
|
6195
6193
|
// Max visit would be all elements of the queue
|
|
@@ -6235,7 +6233,6 @@ var ts;
|
|
|
6235
6233
|
}
|
|
6236
6234
|
}
|
|
6237
6235
|
}
|
|
6238
|
-
/* @internal */
|
|
6239
6236
|
function createDynamicPriorityPollingWatchFile(host) {
|
|
6240
6237
|
var watchedFiles = [];
|
|
6241
6238
|
var changedFilesInLastPoll = [];
|
|
@@ -6344,7 +6341,6 @@ var ts;
|
|
|
6344
6341
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));
|
|
6345
6342
|
}
|
|
6346
6343
|
}
|
|
6347
|
-
ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile;
|
|
6348
6344
|
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
|
|
6349
6345
|
// One file can have multiple watchers
|
|
6350
6346
|
var fileWatcherCallbacks = ts.createMultiMap();
|
|
@@ -6423,42 +6419,38 @@ var ts;
|
|
|
6423
6419
|
pollScheduled = host.setTimeout(pollQueue, PollingInterval.High);
|
|
6424
6420
|
}
|
|
6425
6421
|
}
|
|
6426
|
-
|
|
6427
|
-
function createSingleFileWatcherPerName(watchFile, useCaseSensitiveFileNames) {
|
|
6428
|
-
var cache = new ts.Map();
|
|
6429
|
-
var callbacksCache = ts.createMultiMap();
|
|
6422
|
+
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
|
|
6430
6423
|
var toCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6424
|
+
var path = toCanonicalFileName(name);
|
|
6425
|
+
var existing = cache.get(path);
|
|
6426
|
+
if (existing) {
|
|
6427
|
+
existing.callbacks.push(callback);
|
|
6428
|
+
}
|
|
6429
|
+
else {
|
|
6430
|
+
cache.set(path, {
|
|
6431
|
+
watcher: createWatcher((
|
|
6432
|
+
// Cant infer types correctly so lets satisfy checker
|
|
6433
|
+
function (param1, param2, param3) { var _a; return (_a = cache.get(path)) === null || _a === void 0 ? void 0 : _a.callbacks.slice().forEach(function (cb) { return cb(param1, param2, param3); }); })),
|
|
6434
|
+
callbacks: [callback]
|
|
6435
|
+
});
|
|
6436
|
+
}
|
|
6437
|
+
return {
|
|
6438
|
+
close: function () {
|
|
6439
|
+
var watcher = cache.get(path);
|
|
6440
|
+
// Watcher is not expected to be undefined, but if it is normally its because
|
|
6441
|
+
// exception was thrown somewhere else and watch state is not what it should be
|
|
6442
|
+
if (!watcher)
|
|
6443
|
+
return;
|
|
6444
|
+
if (!ts.orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length)
|
|
6445
|
+
return;
|
|
6446
|
+
cache.delete(path);
|
|
6447
|
+
ts.closeFileWatcherOf(watcher);
|
|
6442
6448
|
}
|
|
6443
|
-
callbacksCache.add(path, callback);
|
|
6444
|
-
return {
|
|
6445
|
-
close: function () {
|
|
6446
|
-
var watcher = ts.Debug.checkDefined(cache.get(path));
|
|
6447
|
-
callbacksCache.remove(path, callback);
|
|
6448
|
-
watcher.refCount--;
|
|
6449
|
-
if (watcher.refCount)
|
|
6450
|
-
return;
|
|
6451
|
-
cache.delete(path);
|
|
6452
|
-
ts.closeFileWatcherOf(watcher);
|
|
6453
|
-
}
|
|
6454
|
-
};
|
|
6455
6449
|
};
|
|
6456
6450
|
}
|
|
6457
|
-
ts.createSingleFileWatcherPerName = createSingleFileWatcherPerName;
|
|
6458
6451
|
/**
|
|
6459
6452
|
* Returns true if file status changed
|
|
6460
6453
|
*/
|
|
6461
|
-
/*@internal*/
|
|
6462
6454
|
function onWatchedFileStat(watchedFile, modifiedTime) {
|
|
6463
6455
|
var oldTime = watchedFile.mtime.getTime();
|
|
6464
6456
|
var newTime = modifiedTime.getTime();
|
|
@@ -6470,7 +6462,6 @@ var ts;
|
|
|
6470
6462
|
}
|
|
6471
6463
|
return false;
|
|
6472
6464
|
}
|
|
6473
|
-
ts.onWatchedFileStat = onWatchedFileStat;
|
|
6474
6465
|
/*@internal*/
|
|
6475
6466
|
function getFileWatcherEventKind(oldTime, newTime) {
|
|
6476
6467
|
return oldTime === 0
|
|
@@ -6498,7 +6489,6 @@ var ts;
|
|
|
6498
6489
|
* that means if this is recursive watcher, watch the children directories as well
|
|
6499
6490
|
* (eg on OS that dont support recursive watch using fs.watch use fs.watchFile)
|
|
6500
6491
|
*/
|
|
6501
|
-
/*@internal*/
|
|
6502
6492
|
function createDirectoryWatcherSupportingRecursive(_a) {
|
|
6503
6493
|
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;
|
|
6504
6494
|
var cache = new ts.Map();
|
|
@@ -6707,18 +6697,15 @@ var ts;
|
|
|
6707
6697
|
return ts.stringContains(toCanonicalFilePath(path), searchPath);
|
|
6708
6698
|
}
|
|
6709
6699
|
}
|
|
6710
|
-
ts.createDirectoryWatcherSupportingRecursive = createDirectoryWatcherSupportingRecursive;
|
|
6711
6700
|
/*@internal*/
|
|
6712
6701
|
var FileSystemEntryKind;
|
|
6713
6702
|
(function (FileSystemEntryKind) {
|
|
6714
6703
|
FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
|
|
6715
6704
|
FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
|
|
6716
6705
|
})(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
|
|
6717
|
-
/*@internal*/
|
|
6718
6706
|
function createFileWatcherCallback(callback) {
|
|
6719
6707
|
return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
|
|
6720
6708
|
}
|
|
6721
|
-
ts.createFileWatcherCallback = createFileWatcherCallback;
|
|
6722
6709
|
function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
|
|
6723
6710
|
return function (eventName, _relativeFileName, modifiedTime) {
|
|
6724
6711
|
if (eventName === "rename") {
|
|
@@ -6752,7 +6739,10 @@ var ts;
|
|
|
6752
6739
|
}
|
|
6753
6740
|
/*@internal*/
|
|
6754
6741
|
function createSystemWatchFunctions(_a) {
|
|
6755
|
-
var
|
|
6742
|
+
var pollingWatchFileWorker = _a.pollingWatchFileWorker, 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;
|
|
6743
|
+
var pollingWatches = new ts.Map();
|
|
6744
|
+
var fsWatches = new ts.Map();
|
|
6745
|
+
var fsWatchesRecursive = new ts.Map();
|
|
6756
6746
|
var dynamicPollingWatchFile;
|
|
6757
6747
|
var fixedChunkSizePollingWatchFile;
|
|
6758
6748
|
var nonPollingWatchFile;
|
|
@@ -6816,7 +6806,7 @@ var ts;
|
|
|
6816
6806
|
// Use notifications from FS to watch with falling back to fs.watchFile
|
|
6817
6807
|
generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :
|
|
6818
6808
|
// Default to do not use fixed polling interval
|
|
6819
|
-
{ watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.
|
|
6809
|
+
{ watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.UseFsEvents };
|
|
6820
6810
|
}
|
|
6821
6811
|
}
|
|
6822
6812
|
function generateWatchFileOptions(watchFile, fallbackPolling, options) {
|
|
@@ -6887,7 +6877,13 @@ var ts;
|
|
|
6887
6877
|
};
|
|
6888
6878
|
}
|
|
6889
6879
|
}
|
|
6880
|
+
function pollingWatchFile(fileName, callback, pollingInterval, options) {
|
|
6881
|
+
return createSingleWatcherPerName(pollingWatches, useCaseSensitiveFileNames, fileName, callback, function (cb) { return pollingWatchFileWorker(fileName, cb, pollingInterval, options); });
|
|
6882
|
+
}
|
|
6890
6883
|
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
6884
|
+
return createSingleWatcherPerName(recursive ? fsWatchesRecursive : fsWatches, useCaseSensitiveFileNames, fileOrDirectory, callback, function (cb) { return fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions); });
|
|
6885
|
+
}
|
|
6886
|
+
function fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
6891
6887
|
var lastDirectoryPartWithDirectorySeparator;
|
|
6892
6888
|
var lastDirectoryPart;
|
|
6893
6889
|
if (inodeWatching) {
|
|
@@ -7066,7 +7062,7 @@ var ts;
|
|
|
7066
7062
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7067
7063
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7068
7064
|
var _b = createSystemWatchFunctions({
|
|
7069
|
-
|
|
7065
|
+
pollingWatchFileWorker: fsWatchFileWorker,
|
|
7070
7066
|
getModifiedTime: getModifiedTime,
|
|
7071
7067
|
setTimeout: setTimeout,
|
|
7072
7068
|
clearTimeout: clearTimeout,
|
|
@@ -39902,6 +39898,7 @@ var ts;
|
|
|
39902
39898
|
shortName: "h",
|
|
39903
39899
|
type: "boolean",
|
|
39904
39900
|
showInSimplifiedHelpView: true,
|
|
39901
|
+
isCommandLineOnly: true,
|
|
39905
39902
|
category: ts.Diagnostics.Command_line_Options,
|
|
39906
39903
|
description: ts.Diagnostics.Print_this_message,
|
|
39907
39904
|
defaultValueDescription: false,
|
|
@@ -39910,6 +39907,8 @@ var ts;
|
|
|
39910
39907
|
name: "help",
|
|
39911
39908
|
shortName: "?",
|
|
39912
39909
|
type: "boolean",
|
|
39910
|
+
isCommandLineOnly: true,
|
|
39911
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
39913
39912
|
defaultValueDescription: false,
|
|
39914
39913
|
},
|
|
39915
39914
|
{
|
|
@@ -66888,8 +66887,8 @@ var ts;
|
|
|
66888
66887
|
var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
66889
66888
|
var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
66890
66889
|
// TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
|
|
66891
|
-
if (result = skipTrue ? -1 /* Ternary.True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false)) {
|
|
66892
|
-
result &= skipFalse ? -1 /* Ternary.True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false);
|
|
66890
|
+
if (result = skipTrue ? -1 /* Ternary.True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
66891
|
+
result &= skipFalse ? -1 /* Ternary.True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState);
|
|
66893
66892
|
if (result) {
|
|
66894
66893
|
return result;
|
|
66895
66894
|
}
|
|
@@ -90605,7 +90604,7 @@ var ts;
|
|
|
90605
90604
|
return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
90606
90605
|
}
|
|
90607
90606
|
var nodeArguments = node.arguments;
|
|
90608
|
-
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext) {
|
|
90607
|
+
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext && moduleKind !== ts.ModuleKind.Node16) {
|
|
90609
90608
|
// We are allowed trailing comma after proposal-import-assertions.
|
|
90610
90609
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
90611
90610
|
if (nodeArguments.length > 1) {
|
|
@@ -148838,7 +148837,7 @@ var ts;
|
|
|
148838
148837
|
rule("SpaceAfterQuestionMarkInConditionalOperator", 57 /* SyntaxKind.QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isConditionalOperatorContext], 4 /* RuleAction.InsertSpace */),
|
|
148839
148838
|
// in other cases there should be no space between '?' and next token
|
|
148840
148839
|
rule("NoSpaceAfterQuestionMark", 57 /* SyntaxKind.QuestionToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* RuleAction.DeleteSpace */),
|
|
148841
|
-
rule("NoSpaceBeforeDot", anyToken, [24 /* SyntaxKind.DotToken */, 28 /* SyntaxKind.QuestionDotToken */], [isNonJsxSameLineTokenContext], 16 /* RuleAction.DeleteSpace */),
|
|
148840
|
+
rule("NoSpaceBeforeDot", anyToken, [24 /* SyntaxKind.DotToken */, 28 /* SyntaxKind.QuestionDotToken */], [isNonJsxSameLineTokenContext, isNotPropertyAccessOnNumericLiteral], 16 /* RuleAction.DeleteSpace */),
|
|
148842
148841
|
rule("NoSpaceAfterDot", [24 /* SyntaxKind.DotToken */, 28 /* SyntaxKind.QuestionDotToken */], anyToken, [isNonJsxSameLineTokenContext], 16 /* RuleAction.DeleteSpace */),
|
|
148843
148842
|
rule("NoSpaceBetweenImportParenInImportType", 100 /* SyntaxKind.ImportKeyword */, 20 /* SyntaxKind.OpenParenToken */, [isNonJsxSameLineTokenContext, isImportTypeContext], 16 /* RuleAction.DeleteSpace */),
|
|
148844
148843
|
// Special handling of unary operators.
|
|
@@ -149508,6 +149507,9 @@ var ts;
|
|
|
149508
149507
|
function isSemicolonInsertionContext(context) {
|
|
149509
149508
|
return ts.positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
|
|
149510
149509
|
}
|
|
149510
|
+
function isNotPropertyAccessOnNumericLiteral(context) {
|
|
149511
|
+
return !ts.isPropertyAccessExpression(context.contextNode) || !ts.isNumericLiteral(context.contextNode.expression);
|
|
149512
|
+
}
|
|
149511
149513
|
})(formatting = ts.formatting || (ts.formatting = {}));
|
|
149512
149514
|
})(ts || (ts = {}));
|
|
149513
149515
|
/* @internal */
|
package/lib/typescript.js
CHANGED
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220909");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -6137,7 +6137,6 @@ var ts;
|
|
|
6137
6137
|
var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
6138
6138
|
/* @internal */
|
|
6139
6139
|
ts.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
6140
|
-
/* @internal */
|
|
6141
6140
|
function setCustomPollingValues(system) {
|
|
6142
6141
|
if (!system.getEnvironmentVariable) {
|
|
6143
6142
|
return;
|
|
@@ -6180,7 +6179,6 @@ var ts;
|
|
|
6180
6179
|
createPollingIntervalBasedLevels(customLevels ? __assign(__assign({}, defaultLevels), customLevels) : defaultLevels);
|
|
6181
6180
|
}
|
|
6182
6181
|
}
|
|
6183
|
-
ts.setCustomPollingValues = setCustomPollingValues;
|
|
6184
6182
|
function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) {
|
|
6185
6183
|
var definedValueCopyToIndex = pollIndex;
|
|
6186
6184
|
// Max visit would be all elements of the queue
|
|
@@ -6226,7 +6224,6 @@ var ts;
|
|
|
6226
6224
|
}
|
|
6227
6225
|
}
|
|
6228
6226
|
}
|
|
6229
|
-
/* @internal */
|
|
6230
6227
|
function createDynamicPriorityPollingWatchFile(host) {
|
|
6231
6228
|
var watchedFiles = [];
|
|
6232
6229
|
var changedFilesInLastPoll = [];
|
|
@@ -6335,7 +6332,6 @@ var ts;
|
|
|
6335
6332
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));
|
|
6336
6333
|
}
|
|
6337
6334
|
}
|
|
6338
|
-
ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile;
|
|
6339
6335
|
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
|
|
6340
6336
|
// One file can have multiple watchers
|
|
6341
6337
|
var fileWatcherCallbacks = ts.createMultiMap();
|
|
@@ -6414,42 +6410,38 @@ var ts;
|
|
|
6414
6410
|
pollScheduled = host.setTimeout(pollQueue, PollingInterval.High);
|
|
6415
6411
|
}
|
|
6416
6412
|
}
|
|
6417
|
-
|
|
6418
|
-
function createSingleFileWatcherPerName(watchFile, useCaseSensitiveFileNames) {
|
|
6419
|
-
var cache = new ts.Map();
|
|
6420
|
-
var callbacksCache = ts.createMultiMap();
|
|
6413
|
+
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
|
|
6421
6414
|
var toCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6415
|
+
var path = toCanonicalFileName(name);
|
|
6416
|
+
var existing = cache.get(path);
|
|
6417
|
+
if (existing) {
|
|
6418
|
+
existing.callbacks.push(callback);
|
|
6419
|
+
}
|
|
6420
|
+
else {
|
|
6421
|
+
cache.set(path, {
|
|
6422
|
+
watcher: createWatcher((
|
|
6423
|
+
// Cant infer types correctly so lets satisfy checker
|
|
6424
|
+
function (param1, param2, param3) { var _a; return (_a = cache.get(path)) === null || _a === void 0 ? void 0 : _a.callbacks.slice().forEach(function (cb) { return cb(param1, param2, param3); }); })),
|
|
6425
|
+
callbacks: [callback]
|
|
6426
|
+
});
|
|
6427
|
+
}
|
|
6428
|
+
return {
|
|
6429
|
+
close: function () {
|
|
6430
|
+
var watcher = cache.get(path);
|
|
6431
|
+
// Watcher is not expected to be undefined, but if it is normally its because
|
|
6432
|
+
// exception was thrown somewhere else and watch state is not what it should be
|
|
6433
|
+
if (!watcher)
|
|
6434
|
+
return;
|
|
6435
|
+
if (!ts.orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length)
|
|
6436
|
+
return;
|
|
6437
|
+
cache.delete(path);
|
|
6438
|
+
ts.closeFileWatcherOf(watcher);
|
|
6433
6439
|
}
|
|
6434
|
-
callbacksCache.add(path, callback);
|
|
6435
|
-
return {
|
|
6436
|
-
close: function () {
|
|
6437
|
-
var watcher = ts.Debug.checkDefined(cache.get(path));
|
|
6438
|
-
callbacksCache.remove(path, callback);
|
|
6439
|
-
watcher.refCount--;
|
|
6440
|
-
if (watcher.refCount)
|
|
6441
|
-
return;
|
|
6442
|
-
cache.delete(path);
|
|
6443
|
-
ts.closeFileWatcherOf(watcher);
|
|
6444
|
-
}
|
|
6445
|
-
};
|
|
6446
6440
|
};
|
|
6447
6441
|
}
|
|
6448
|
-
ts.createSingleFileWatcherPerName = createSingleFileWatcherPerName;
|
|
6449
6442
|
/**
|
|
6450
6443
|
* Returns true if file status changed
|
|
6451
6444
|
*/
|
|
6452
|
-
/*@internal*/
|
|
6453
6445
|
function onWatchedFileStat(watchedFile, modifiedTime) {
|
|
6454
6446
|
var oldTime = watchedFile.mtime.getTime();
|
|
6455
6447
|
var newTime = modifiedTime.getTime();
|
|
@@ -6461,7 +6453,6 @@ var ts;
|
|
|
6461
6453
|
}
|
|
6462
6454
|
return false;
|
|
6463
6455
|
}
|
|
6464
|
-
ts.onWatchedFileStat = onWatchedFileStat;
|
|
6465
6456
|
/*@internal*/
|
|
6466
6457
|
function getFileWatcherEventKind(oldTime, newTime) {
|
|
6467
6458
|
return oldTime === 0
|
|
@@ -6489,7 +6480,6 @@ var ts;
|
|
|
6489
6480
|
* that means if this is recursive watcher, watch the children directories as well
|
|
6490
6481
|
* (eg on OS that dont support recursive watch using fs.watch use fs.watchFile)
|
|
6491
6482
|
*/
|
|
6492
|
-
/*@internal*/
|
|
6493
6483
|
function createDirectoryWatcherSupportingRecursive(_a) {
|
|
6494
6484
|
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;
|
|
6495
6485
|
var cache = new ts.Map();
|
|
@@ -6698,18 +6688,15 @@ var ts;
|
|
|
6698
6688
|
return ts.stringContains(toCanonicalFilePath(path), searchPath);
|
|
6699
6689
|
}
|
|
6700
6690
|
}
|
|
6701
|
-
ts.createDirectoryWatcherSupportingRecursive = createDirectoryWatcherSupportingRecursive;
|
|
6702
6691
|
/*@internal*/
|
|
6703
6692
|
var FileSystemEntryKind;
|
|
6704
6693
|
(function (FileSystemEntryKind) {
|
|
6705
6694
|
FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File";
|
|
6706
6695
|
FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory";
|
|
6707
6696
|
})(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));
|
|
6708
|
-
/*@internal*/
|
|
6709
6697
|
function createFileWatcherCallback(callback) {
|
|
6710
6698
|
return function (_fileName, eventKind, modifiedTime) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); };
|
|
6711
6699
|
}
|
|
6712
|
-
ts.createFileWatcherCallback = createFileWatcherCallback;
|
|
6713
6700
|
function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime) {
|
|
6714
6701
|
return function (eventName, _relativeFileName, modifiedTime) {
|
|
6715
6702
|
if (eventName === "rename") {
|
|
@@ -6743,7 +6730,10 @@ var ts;
|
|
|
6743
6730
|
}
|
|
6744
6731
|
/*@internal*/
|
|
6745
6732
|
function createSystemWatchFunctions(_a) {
|
|
6746
|
-
var
|
|
6733
|
+
var pollingWatchFileWorker = _a.pollingWatchFileWorker, 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;
|
|
6734
|
+
var pollingWatches = new ts.Map();
|
|
6735
|
+
var fsWatches = new ts.Map();
|
|
6736
|
+
var fsWatchesRecursive = new ts.Map();
|
|
6747
6737
|
var dynamicPollingWatchFile;
|
|
6748
6738
|
var fixedChunkSizePollingWatchFile;
|
|
6749
6739
|
var nonPollingWatchFile;
|
|
@@ -6807,7 +6797,7 @@ var ts;
|
|
|
6807
6797
|
// Use notifications from FS to watch with falling back to fs.watchFile
|
|
6808
6798
|
generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :
|
|
6809
6799
|
// Default to do not use fixed polling interval
|
|
6810
|
-
{ watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.
|
|
6800
|
+
{ watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.UseFsEvents };
|
|
6811
6801
|
}
|
|
6812
6802
|
}
|
|
6813
6803
|
function generateWatchFileOptions(watchFile, fallbackPolling, options) {
|
|
@@ -6878,7 +6868,13 @@ var ts;
|
|
|
6878
6868
|
};
|
|
6879
6869
|
}
|
|
6880
6870
|
}
|
|
6871
|
+
function pollingWatchFile(fileName, callback, pollingInterval, options) {
|
|
6872
|
+
return createSingleWatcherPerName(pollingWatches, useCaseSensitiveFileNames, fileName, callback, function (cb) { return pollingWatchFileWorker(fileName, cb, pollingInterval, options); });
|
|
6873
|
+
}
|
|
6881
6874
|
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
6875
|
+
return createSingleWatcherPerName(recursive ? fsWatchesRecursive : fsWatches, useCaseSensitiveFileNames, fileOrDirectory, callback, function (cb) { return fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions); });
|
|
6876
|
+
}
|
|
6877
|
+
function fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
6882
6878
|
var lastDirectoryPartWithDirectorySeparator;
|
|
6883
6879
|
var lastDirectoryPart;
|
|
6884
6880
|
if (inodeWatching) {
|
|
@@ -7057,7 +7053,7 @@ var ts;
|
|
|
7057
7053
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7058
7054
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7059
7055
|
var _b = createSystemWatchFunctions({
|
|
7060
|
-
|
|
7056
|
+
pollingWatchFileWorker: fsWatchFileWorker,
|
|
7061
7057
|
getModifiedTime: getModifiedTime,
|
|
7062
7058
|
setTimeout: setTimeout,
|
|
7063
7059
|
clearTimeout: clearTimeout,
|
|
@@ -39893,6 +39889,7 @@ var ts;
|
|
|
39893
39889
|
shortName: "h",
|
|
39894
39890
|
type: "boolean",
|
|
39895
39891
|
showInSimplifiedHelpView: true,
|
|
39892
|
+
isCommandLineOnly: true,
|
|
39896
39893
|
category: ts.Diagnostics.Command_line_Options,
|
|
39897
39894
|
description: ts.Diagnostics.Print_this_message,
|
|
39898
39895
|
defaultValueDescription: false,
|
|
@@ -39901,6 +39898,8 @@ var ts;
|
|
|
39901
39898
|
name: "help",
|
|
39902
39899
|
shortName: "?",
|
|
39903
39900
|
type: "boolean",
|
|
39901
|
+
isCommandLineOnly: true,
|
|
39902
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
39904
39903
|
defaultValueDescription: false,
|
|
39905
39904
|
},
|
|
39906
39905
|
{
|
|
@@ -66879,8 +66878,8 @@ var ts;
|
|
|
66879
66878
|
var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
66880
66879
|
var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
66881
66880
|
// TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
|
|
66882
|
-
if (result = skipTrue ? -1 /* Ternary.True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false)) {
|
|
66883
|
-
result &= skipFalse ? -1 /* Ternary.True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false);
|
|
66881
|
+
if (result = skipTrue ? -1 /* Ternary.True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
66882
|
+
result &= skipFalse ? -1 /* Ternary.True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* RecursionFlags.Target */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState);
|
|
66884
66883
|
if (result) {
|
|
66885
66884
|
return result;
|
|
66886
66885
|
}
|
|
@@ -90596,7 +90595,7 @@ var ts;
|
|
|
90596
90595
|
return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
90597
90596
|
}
|
|
90598
90597
|
var nodeArguments = node.arguments;
|
|
90599
|
-
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext) {
|
|
90598
|
+
if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext && moduleKind !== ts.ModuleKind.Node16) {
|
|
90600
90599
|
// We are allowed trailing comma after proposal-import-assertions.
|
|
90601
90600
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
90602
90601
|
if (nodeArguments.length > 1) {
|
|
@@ -148829,7 +148828,7 @@ var ts;
|
|
|
148829
148828
|
rule("SpaceAfterQuestionMarkInConditionalOperator", 57 /* SyntaxKind.QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isConditionalOperatorContext], 4 /* RuleAction.InsertSpace */),
|
|
148830
148829
|
// in other cases there should be no space between '?' and next token
|
|
148831
148830
|
rule("NoSpaceAfterQuestionMark", 57 /* SyntaxKind.QuestionToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* RuleAction.DeleteSpace */),
|
|
148832
|
-
rule("NoSpaceBeforeDot", anyToken, [24 /* SyntaxKind.DotToken */, 28 /* SyntaxKind.QuestionDotToken */], [isNonJsxSameLineTokenContext], 16 /* RuleAction.DeleteSpace */),
|
|
148831
|
+
rule("NoSpaceBeforeDot", anyToken, [24 /* SyntaxKind.DotToken */, 28 /* SyntaxKind.QuestionDotToken */], [isNonJsxSameLineTokenContext, isNotPropertyAccessOnNumericLiteral], 16 /* RuleAction.DeleteSpace */),
|
|
148833
148832
|
rule("NoSpaceAfterDot", [24 /* SyntaxKind.DotToken */, 28 /* SyntaxKind.QuestionDotToken */], anyToken, [isNonJsxSameLineTokenContext], 16 /* RuleAction.DeleteSpace */),
|
|
148834
148833
|
rule("NoSpaceBetweenImportParenInImportType", 100 /* SyntaxKind.ImportKeyword */, 20 /* SyntaxKind.OpenParenToken */, [isNonJsxSameLineTokenContext, isImportTypeContext], 16 /* RuleAction.DeleteSpace */),
|
|
148835
148834
|
// Special handling of unary operators.
|
|
@@ -149499,6 +149498,9 @@ var ts;
|
|
|
149499
149498
|
function isSemicolonInsertionContext(context) {
|
|
149500
149499
|
return ts.positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
|
|
149501
149500
|
}
|
|
149501
|
+
function isNotPropertyAccessOnNumericLiteral(context) {
|
|
149502
|
+
return !ts.isPropertyAccessExpression(context.contextNode) || !ts.isNumericLiteral(context.contextNode.expression);
|
|
149503
|
+
}
|
|
149502
149504
|
})(formatting = ts.formatting || (ts.formatting = {}));
|
|
149503
149505
|
})(ts || (ts = {}));
|
|
149504
149506
|
/* @internal */
|