typescript 5.4.3 → 5.4.5
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 +56 -22
- package/lib/tsserver.js +128 -77
- package/lib/typescript.d.ts +5 -3
- package/lib/typescript.js +128 -77
- package/lib/typingsInstaller.js +28 -8
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = "5.4.
|
|
21
|
+
var version = "5.4.5";
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -4145,14 +4145,17 @@ function createDynamicPriorityPollingWatchFile(host) {
|
|
|
4145
4145
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
|
4146
4146
|
}
|
|
4147
4147
|
}
|
|
4148
|
-
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
|
4148
|
+
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) {
|
|
4149
4149
|
const fileWatcherCallbacks = createMultiMap();
|
|
4150
|
+
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
|
|
4150
4151
|
const dirWatchers = /* @__PURE__ */ new Map();
|
|
4151
4152
|
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
4152
4153
|
return nonPollingWatchFile;
|
|
4153
4154
|
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
|
4154
4155
|
const filePath = toCanonicalName(fileName);
|
|
4155
|
-
fileWatcherCallbacks.add(filePath, callback)
|
|
4156
|
+
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
|
|
4157
|
+
fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime);
|
|
4158
|
+
}
|
|
4156
4159
|
const dirPath = getDirectoryPath(filePath) || ".";
|
|
4157
4160
|
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
|
|
4158
4161
|
watcher.referenceCount++;
|
|
@@ -4172,14 +4175,31 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi
|
|
|
4172
4175
|
const watcher = fsWatch(
|
|
4173
4176
|
dirName,
|
|
4174
4177
|
1 /* Directory */,
|
|
4175
|
-
(
|
|
4178
|
+
(eventName, relativeFileName) => {
|
|
4176
4179
|
if (!isString(relativeFileName))
|
|
4177
4180
|
return;
|
|
4178
4181
|
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
|
|
4179
|
-
const
|
|
4182
|
+
const filePath = toCanonicalName(fileName);
|
|
4183
|
+
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
|
|
4180
4184
|
if (callbacks) {
|
|
4185
|
+
let currentModifiedTime;
|
|
4186
|
+
let eventKind = 1 /* Changed */;
|
|
4187
|
+
if (fileTimestamps) {
|
|
4188
|
+
const existingTime = fileTimestamps.get(filePath);
|
|
4189
|
+
if (eventName === "change") {
|
|
4190
|
+
currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime;
|
|
4191
|
+
if (currentModifiedTime.getTime() === existingTime.getTime())
|
|
4192
|
+
return;
|
|
4193
|
+
}
|
|
4194
|
+
currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime);
|
|
4195
|
+
fileTimestamps.set(filePath, currentModifiedTime);
|
|
4196
|
+
if (existingTime === missingFileModifiedTime)
|
|
4197
|
+
eventKind = 0 /* Created */;
|
|
4198
|
+
else if (currentModifiedTime === missingFileModifiedTime)
|
|
4199
|
+
eventKind = 2 /* Deleted */;
|
|
4200
|
+
}
|
|
4181
4201
|
for (const fileCallback of callbacks) {
|
|
4182
|
-
fileCallback(fileName,
|
|
4202
|
+
fileCallback(fileName, eventKind, currentModifiedTime);
|
|
4183
4203
|
}
|
|
4184
4204
|
}
|
|
4185
4205
|
},
|
|
@@ -4573,7 +4593,7 @@ function createSystemWatchFunctions({
|
|
|
4573
4593
|
);
|
|
4574
4594
|
case 5 /* UseFsEventsOnParentDirectory */:
|
|
4575
4595
|
if (!nonPollingWatchFile) {
|
|
4576
|
-
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
|
4596
|
+
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp);
|
|
4577
4597
|
}
|
|
4578
4598
|
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
|
4579
4599
|
default:
|
|
@@ -4748,7 +4768,7 @@ function createSystemWatchFunctions({
|
|
|
4748
4768
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4749
4769
|
}
|
|
4750
4770
|
try {
|
|
4751
|
-
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
4771
|
+
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
4752
4772
|
fileOrDirectory,
|
|
4753
4773
|
recursive,
|
|
4754
4774
|
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
|
|
@@ -42862,13 +42882,21 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
|
|
|
42862
42882
|
}
|
|
42863
42883
|
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
|
|
42864
42884
|
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
|
|
42865
|
-
|
|
42885
|
+
const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
|
|
42886
|
+
if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
|
|
42866
42887
|
return maybeNonRelative;
|
|
42867
42888
|
}
|
|
42868
42889
|
return relativePath;
|
|
42869
42890
|
}
|
|
42870
42891
|
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
|
|
42871
42892
|
}
|
|
42893
|
+
function packageJsonPathsAreEqual(a, b, ignoreCase) {
|
|
42894
|
+
if (a === b)
|
|
42895
|
+
return true;
|
|
42896
|
+
if (a === void 0 || b === void 0)
|
|
42897
|
+
return false;
|
|
42898
|
+
return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
|
|
42899
|
+
}
|
|
42872
42900
|
function countPathComponents(path) {
|
|
42873
42901
|
let count = 0;
|
|
42874
42902
|
for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
|
|
@@ -47996,15 +48024,19 @@ function createTypeChecker(host) {
|
|
|
47996
48024
|
return true;
|
|
47997
48025
|
}
|
|
47998
48026
|
}
|
|
47999
|
-
function
|
|
48027
|
+
function getMeaningOfEntityNameReference(entityName) {
|
|
48000
48028
|
let meaning;
|
|
48001
48029
|
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
|
|
48002
48030
|
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
48003
|
-
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */) {
|
|
48031
|
+
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
|
|
48004
48032
|
meaning = 1920 /* Namespace */;
|
|
48005
48033
|
} else {
|
|
48006
48034
|
meaning = 788968 /* Type */;
|
|
48007
48035
|
}
|
|
48036
|
+
return meaning;
|
|
48037
|
+
}
|
|
48038
|
+
function isEntityNameVisible(entityName, enclosingDeclaration) {
|
|
48039
|
+
const meaning = getMeaningOfEntityNameReference(entityName);
|
|
48008
48040
|
const firstIdentifier = getFirstIdentifier(entityName);
|
|
48009
48041
|
const symbol = resolveName(
|
|
48010
48042
|
enclosingDeclaration,
|
|
@@ -50065,9 +50097,10 @@ function createTypeChecker(host) {
|
|
|
50065
50097
|
introducesError = true;
|
|
50066
50098
|
return { introducesError, node };
|
|
50067
50099
|
}
|
|
50100
|
+
const meaning = getMeaningOfEntityNameReference(node);
|
|
50068
50101
|
const sym = resolveEntityName(
|
|
50069
50102
|
leftmost,
|
|
50070
|
-
|
|
50103
|
+
meaning,
|
|
50071
50104
|
/*ignoreErrors*/
|
|
50072
50105
|
true,
|
|
50073
50106
|
/*dontResolveAlias*/
|
|
@@ -50077,13 +50110,13 @@ function createTypeChecker(host) {
|
|
|
50077
50110
|
if (isSymbolAccessible(
|
|
50078
50111
|
sym,
|
|
50079
50112
|
context.enclosingDeclaration,
|
|
50080
|
-
|
|
50113
|
+
meaning,
|
|
50081
50114
|
/*shouldComputeAliasesToMakeVisible*/
|
|
50082
50115
|
false
|
|
50083
50116
|
).accessibility !== 0 /* Accessible */) {
|
|
50084
50117
|
introducesError = true;
|
|
50085
50118
|
} else {
|
|
50086
|
-
context.tracker.trackSymbol(sym, context.enclosingDeclaration,
|
|
50119
|
+
context.tracker.trackSymbol(sym, context.enclosingDeclaration, meaning);
|
|
50087
50120
|
includePrivateSymbol == null ? void 0 : includePrivateSymbol(sym);
|
|
50088
50121
|
}
|
|
50089
50122
|
if (isIdentifier(node)) {
|
|
@@ -55311,12 +55344,10 @@ function createTypeChecker(host) {
|
|
|
55311
55344
|
const target = type.target ?? type;
|
|
55312
55345
|
const typeVariable = getHomomorphicTypeVariable(target);
|
|
55313
55346
|
if (typeVariable && !target.declaration.nameType) {
|
|
55314
|
-
const
|
|
55315
|
-
|
|
55316
|
-
|
|
55317
|
-
|
|
55318
|
-
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
55319
|
-
}
|
|
55347
|
+
const modifiersType = getModifiersTypeFromMappedType(type);
|
|
55348
|
+
const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType);
|
|
55349
|
+
if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
|
|
55350
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
55320
55351
|
}
|
|
55321
55352
|
}
|
|
55322
55353
|
return type;
|
|
@@ -55477,13 +55508,13 @@ function createTypeChecker(host) {
|
|
|
55477
55508
|
}
|
|
55478
55509
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
55479
55510
|
var _a, _b, _c;
|
|
55480
|
-
let property = (
|
|
55511
|
+
let property = skipObjectFunctionPropertyAugment ? (_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name) : (_b = type.propertyCache) == null ? void 0 : _b.get(name);
|
|
55481
55512
|
if (!property) {
|
|
55482
55513
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
55483
55514
|
if (property) {
|
|
55484
55515
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
55485
55516
|
properties.set(name, property);
|
|
55486
|
-
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
55517
|
+
if (skipObjectFunctionPropertyAugment && !(getCheckFlags(property) & 48 /* Partial */) && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
55487
55518
|
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
55488
55519
|
properties2.set(name, property);
|
|
55489
55520
|
}
|
|
@@ -57990,6 +58021,9 @@ function createTypeChecker(host) {
|
|
|
57990
58021
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
57991
58022
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
57992
58023
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
58024
|
+
} else if (typeSet.length >= 4) {
|
|
58025
|
+
const middle = Math.floor(typeSet.length / 2);
|
|
58026
|
+
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
|
|
57993
58027
|
} else {
|
|
57994
58028
|
if (!checkCrossProductUnion(typeSet)) {
|
|
57995
58029
|
return errorType;
|
package/lib/tsserver.js
CHANGED
|
@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2340
2340
|
|
|
2341
2341
|
// src/compiler/corePublic.ts
|
|
2342
2342
|
var versionMajorMinor = "5.4";
|
|
2343
|
-
var version = "5.4.
|
|
2343
|
+
var version = "5.4.5";
|
|
2344
2344
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2345
2345
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2346
2346
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7688,14 +7688,17 @@ function createDynamicPriorityPollingWatchFile(host) {
|
|
|
7688
7688
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
|
7689
7689
|
}
|
|
7690
7690
|
}
|
|
7691
|
-
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
|
7691
|
+
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) {
|
|
7692
7692
|
const fileWatcherCallbacks = createMultiMap();
|
|
7693
|
+
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
|
|
7693
7694
|
const dirWatchers = /* @__PURE__ */ new Map();
|
|
7694
7695
|
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
7695
7696
|
return nonPollingWatchFile;
|
|
7696
7697
|
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
|
7697
7698
|
const filePath = toCanonicalName(fileName);
|
|
7698
|
-
fileWatcherCallbacks.add(filePath, callback)
|
|
7699
|
+
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
|
|
7700
|
+
fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime);
|
|
7701
|
+
}
|
|
7699
7702
|
const dirPath = getDirectoryPath(filePath) || ".";
|
|
7700
7703
|
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
|
|
7701
7704
|
watcher.referenceCount++;
|
|
@@ -7715,14 +7718,31 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi
|
|
|
7715
7718
|
const watcher = fsWatch(
|
|
7716
7719
|
dirName,
|
|
7717
7720
|
1 /* Directory */,
|
|
7718
|
-
(
|
|
7721
|
+
(eventName, relativeFileName) => {
|
|
7719
7722
|
if (!isString(relativeFileName))
|
|
7720
7723
|
return;
|
|
7721
7724
|
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
|
|
7722
|
-
const
|
|
7725
|
+
const filePath = toCanonicalName(fileName);
|
|
7726
|
+
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
|
|
7723
7727
|
if (callbacks) {
|
|
7728
|
+
let currentModifiedTime;
|
|
7729
|
+
let eventKind = 1 /* Changed */;
|
|
7730
|
+
if (fileTimestamps) {
|
|
7731
|
+
const existingTime = fileTimestamps.get(filePath);
|
|
7732
|
+
if (eventName === "change") {
|
|
7733
|
+
currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime;
|
|
7734
|
+
if (currentModifiedTime.getTime() === existingTime.getTime())
|
|
7735
|
+
return;
|
|
7736
|
+
}
|
|
7737
|
+
currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime);
|
|
7738
|
+
fileTimestamps.set(filePath, currentModifiedTime);
|
|
7739
|
+
if (existingTime === missingFileModifiedTime)
|
|
7740
|
+
eventKind = 0 /* Created */;
|
|
7741
|
+
else if (currentModifiedTime === missingFileModifiedTime)
|
|
7742
|
+
eventKind = 2 /* Deleted */;
|
|
7743
|
+
}
|
|
7724
7744
|
for (const fileCallback of callbacks) {
|
|
7725
|
-
fileCallback(fileName,
|
|
7745
|
+
fileCallback(fileName, eventKind, currentModifiedTime);
|
|
7726
7746
|
}
|
|
7727
7747
|
}
|
|
7728
7748
|
},
|
|
@@ -8121,7 +8141,7 @@ function createSystemWatchFunctions({
|
|
|
8121
8141
|
);
|
|
8122
8142
|
case 5 /* UseFsEventsOnParentDirectory */:
|
|
8123
8143
|
if (!nonPollingWatchFile) {
|
|
8124
|
-
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
|
8144
|
+
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp);
|
|
8125
8145
|
}
|
|
8126
8146
|
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
|
8127
8147
|
default:
|
|
@@ -8296,7 +8316,7 @@ function createSystemWatchFunctions({
|
|
|
8296
8316
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
8297
8317
|
}
|
|
8298
8318
|
try {
|
|
8299
|
-
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
8319
|
+
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
8300
8320
|
fileOrDirectory,
|
|
8301
8321
|
recursive,
|
|
8302
8322
|
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
|
|
@@ -47606,13 +47626,21 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
|
|
|
47606
47626
|
}
|
|
47607
47627
|
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
|
|
47608
47628
|
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
|
|
47609
|
-
|
|
47629
|
+
const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
|
|
47630
|
+
if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
|
|
47610
47631
|
return maybeNonRelative;
|
|
47611
47632
|
}
|
|
47612
47633
|
return relativePath;
|
|
47613
47634
|
}
|
|
47614
47635
|
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
|
|
47615
47636
|
}
|
|
47637
|
+
function packageJsonPathsAreEqual(a, b, ignoreCase) {
|
|
47638
|
+
if (a === b)
|
|
47639
|
+
return true;
|
|
47640
|
+
if (a === void 0 || b === void 0)
|
|
47641
|
+
return false;
|
|
47642
|
+
return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
|
|
47643
|
+
}
|
|
47616
47644
|
function countPathComponents(path) {
|
|
47617
47645
|
let count = 0;
|
|
47618
47646
|
for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
|
|
@@ -52740,15 +52768,19 @@ function createTypeChecker(host) {
|
|
|
52740
52768
|
return true;
|
|
52741
52769
|
}
|
|
52742
52770
|
}
|
|
52743
|
-
function
|
|
52771
|
+
function getMeaningOfEntityNameReference(entityName) {
|
|
52744
52772
|
let meaning;
|
|
52745
52773
|
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
|
|
52746
52774
|
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
52747
|
-
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */) {
|
|
52775
|
+
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
|
|
52748
52776
|
meaning = 1920 /* Namespace */;
|
|
52749
52777
|
} else {
|
|
52750
52778
|
meaning = 788968 /* Type */;
|
|
52751
52779
|
}
|
|
52780
|
+
return meaning;
|
|
52781
|
+
}
|
|
52782
|
+
function isEntityNameVisible(entityName, enclosingDeclaration) {
|
|
52783
|
+
const meaning = getMeaningOfEntityNameReference(entityName);
|
|
52752
52784
|
const firstIdentifier = getFirstIdentifier(entityName);
|
|
52753
52785
|
const symbol = resolveName(
|
|
52754
52786
|
enclosingDeclaration,
|
|
@@ -54809,9 +54841,10 @@ function createTypeChecker(host) {
|
|
|
54809
54841
|
introducesError = true;
|
|
54810
54842
|
return { introducesError, node };
|
|
54811
54843
|
}
|
|
54844
|
+
const meaning = getMeaningOfEntityNameReference(node);
|
|
54812
54845
|
const sym = resolveEntityName(
|
|
54813
54846
|
leftmost,
|
|
54814
|
-
|
|
54847
|
+
meaning,
|
|
54815
54848
|
/*ignoreErrors*/
|
|
54816
54849
|
true,
|
|
54817
54850
|
/*dontResolveAlias*/
|
|
@@ -54821,13 +54854,13 @@ function createTypeChecker(host) {
|
|
|
54821
54854
|
if (isSymbolAccessible(
|
|
54822
54855
|
sym,
|
|
54823
54856
|
context.enclosingDeclaration,
|
|
54824
|
-
|
|
54857
|
+
meaning,
|
|
54825
54858
|
/*shouldComputeAliasesToMakeVisible*/
|
|
54826
54859
|
false
|
|
54827
54860
|
).accessibility !== 0 /* Accessible */) {
|
|
54828
54861
|
introducesError = true;
|
|
54829
54862
|
} else {
|
|
54830
|
-
context.tracker.trackSymbol(sym, context.enclosingDeclaration,
|
|
54863
|
+
context.tracker.trackSymbol(sym, context.enclosingDeclaration, meaning);
|
|
54831
54864
|
includePrivateSymbol == null ? void 0 : includePrivateSymbol(sym);
|
|
54832
54865
|
}
|
|
54833
54866
|
if (isIdentifier(node)) {
|
|
@@ -60055,12 +60088,10 @@ function createTypeChecker(host) {
|
|
|
60055
60088
|
const target = type.target ?? type;
|
|
60056
60089
|
const typeVariable = getHomomorphicTypeVariable(target);
|
|
60057
60090
|
if (typeVariable && !target.declaration.nameType) {
|
|
60058
|
-
const
|
|
60059
|
-
|
|
60060
|
-
|
|
60061
|
-
|
|
60062
|
-
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
60063
|
-
}
|
|
60091
|
+
const modifiersType = getModifiersTypeFromMappedType(type);
|
|
60092
|
+
const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType);
|
|
60093
|
+
if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
|
|
60094
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
60064
60095
|
}
|
|
60065
60096
|
}
|
|
60066
60097
|
return type;
|
|
@@ -60221,13 +60252,13 @@ function createTypeChecker(host) {
|
|
|
60221
60252
|
}
|
|
60222
60253
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
60223
60254
|
var _a, _b, _c;
|
|
60224
|
-
let property = (
|
|
60255
|
+
let property = skipObjectFunctionPropertyAugment ? (_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name) : (_b = type.propertyCache) == null ? void 0 : _b.get(name);
|
|
60225
60256
|
if (!property) {
|
|
60226
60257
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
60227
60258
|
if (property) {
|
|
60228
60259
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
60229
60260
|
properties.set(name, property);
|
|
60230
|
-
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
60261
|
+
if (skipObjectFunctionPropertyAugment && !(getCheckFlags(property) & 48 /* Partial */) && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
60231
60262
|
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
60232
60263
|
properties2.set(name, property);
|
|
60233
60264
|
}
|
|
@@ -62734,6 +62765,9 @@ function createTypeChecker(host) {
|
|
|
62734
62765
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
62735
62766
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
62736
62767
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
62768
|
+
} else if (typeSet.length >= 4) {
|
|
62769
|
+
const middle = Math.floor(typeSet.length / 2);
|
|
62770
|
+
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
|
|
62737
62771
|
} else {
|
|
62738
62772
|
if (!checkCrossProductUnion(typeSet)) {
|
|
62739
62773
|
return errorType;
|
|
@@ -160423,7 +160457,8 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
|
|
|
160423
160457
|
}
|
|
160424
160458
|
function symbolAppearsToBeTypeOnly(symbol) {
|
|
160425
160459
|
var _a;
|
|
160426
|
-
|
|
160460
|
+
const flags = getCombinedLocalAndExportSymbolFlags(skipAlias(symbol, typeChecker));
|
|
160461
|
+
return !(flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(flags & 788968 /* Type */));
|
|
160427
160462
|
}
|
|
160428
160463
|
}
|
|
160429
160464
|
function getLabelCompletionAtPosition(node) {
|
|
@@ -160728,10 +160763,7 @@ function getContextualType(previousToken, position, sourceFile, checker) {
|
|
|
160728
160763
|
return isJsxExpression(parent2) && !isJsxElement(parent2.parent) && !isJsxFragment(parent2.parent) ? checker.getContextualTypeForJsxAttribute(parent2.parent) : void 0;
|
|
160729
160764
|
default:
|
|
160730
160765
|
const argInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(previousToken, position, sourceFile, checker);
|
|
160731
|
-
return argInfo ? (
|
|
160732
|
-
// At `,`, treat this as the next argument after the comma.
|
|
160733
|
-
checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === 28 /* CommaToken */ ? 1 : 0))
|
|
160734
|
-
) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
|
|
160766
|
+
return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
|
|
160735
160767
|
// completion at `x ===/**/` should be for the right side
|
|
160736
160768
|
checker.getTypeAtLocation(parent2.left)
|
|
160737
160769
|
) : checker.getContextualType(previousToken, 4 /* Completions */) || checker.getContextualType(previousToken);
|
|
@@ -169099,12 +169131,7 @@ function getArgumentOrParameterListInfo(node, position, sourceFile, checker) {
|
|
|
169099
169131
|
if (!info)
|
|
169100
169132
|
return void 0;
|
|
169101
169133
|
const { list, argumentIndex } = info;
|
|
169102
|
-
const argumentCount = getArgumentCount(
|
|
169103
|
-
list,
|
|
169104
|
-
/*ignoreTrailingComma*/
|
|
169105
|
-
isInString(sourceFile, position, node),
|
|
169106
|
-
checker
|
|
169107
|
-
);
|
|
169134
|
+
const argumentCount = getArgumentCount(checker, list);
|
|
169108
169135
|
if (argumentIndex !== 0) {
|
|
169109
169136
|
Debug.assertLessThan(argumentIndex, argumentCount);
|
|
169110
169137
|
}
|
|
@@ -169116,7 +169143,7 @@ function getArgumentOrParameterListAndIndex(node, sourceFile, checker) {
|
|
|
169116
169143
|
return { list: getChildListThatStartsWithOpenerToken(node.parent, node, sourceFile), argumentIndex: 0 };
|
|
169117
169144
|
} else {
|
|
169118
169145
|
const list = findContainingList(node);
|
|
169119
|
-
return list && { list, argumentIndex: getArgumentIndex(list, node
|
|
169146
|
+
return list && { list, argumentIndex: getArgumentIndex(checker, list, node) };
|
|
169120
169147
|
}
|
|
169121
169148
|
}
|
|
169122
169149
|
function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker) {
|
|
@@ -169246,24 +169273,6 @@ function chooseBetterSymbol(s) {
|
|
|
169246
169273
|
return isFunctionTypeNode(d) ? (_a = tryCast(d.parent, canHaveSymbol)) == null ? void 0 : _a.symbol : void 0;
|
|
169247
169274
|
}) || s : s;
|
|
169248
169275
|
}
|
|
169249
|
-
function getArgumentIndex(argumentsList, node, checker) {
|
|
169250
|
-
const args = argumentsList.getChildren();
|
|
169251
|
-
let argumentIndex = 0;
|
|
169252
|
-
for (let pos = 0; pos < length(args); pos++) {
|
|
169253
|
-
const child = args[pos];
|
|
169254
|
-
if (child === node) {
|
|
169255
|
-
break;
|
|
169256
|
-
}
|
|
169257
|
-
if (isSpreadElement(child)) {
|
|
169258
|
-
argumentIndex = argumentIndex + getSpreadElementCount(child, checker) + (pos > 0 ? pos : 0);
|
|
169259
|
-
} else {
|
|
169260
|
-
if (child.kind !== 28 /* CommaToken */) {
|
|
169261
|
-
argumentIndex++;
|
|
169262
|
-
}
|
|
169263
|
-
}
|
|
169264
|
-
}
|
|
169265
|
-
return argumentIndex;
|
|
169266
|
-
}
|
|
169267
169276
|
function getSpreadElementCount(node, checker) {
|
|
169268
169277
|
const spreadType = checker.getTypeAtLocation(node.expression);
|
|
169269
169278
|
if (checker.isTupleType(spreadType)) {
|
|
@@ -169276,19 +169285,48 @@ function getSpreadElementCount(node, checker) {
|
|
|
169276
169285
|
}
|
|
169277
169286
|
return 0;
|
|
169278
169287
|
}
|
|
169279
|
-
function
|
|
169280
|
-
|
|
169281
|
-
|
|
169282
|
-
|
|
169288
|
+
function getArgumentIndex(checker, argumentsList, node) {
|
|
169289
|
+
return getArgumentIndexOrCount(checker, argumentsList, node);
|
|
169290
|
+
}
|
|
169291
|
+
function getArgumentCount(checker, argumentsList) {
|
|
169292
|
+
return getArgumentIndexOrCount(
|
|
169293
|
+
checker,
|
|
169294
|
+
argumentsList,
|
|
169295
|
+
/*node*/
|
|
169296
|
+
void 0
|
|
169297
|
+
);
|
|
169298
|
+
}
|
|
169299
|
+
function getArgumentIndexOrCount(checker, argumentsList, node) {
|
|
169300
|
+
const args = argumentsList.getChildren();
|
|
169301
|
+
let argumentIndex = 0;
|
|
169302
|
+
let skipComma = false;
|
|
169303
|
+
for (const child of args) {
|
|
169304
|
+
if (node && child === node) {
|
|
169305
|
+
if (!skipComma && child.kind === 28 /* CommaToken */) {
|
|
169306
|
+
argumentIndex++;
|
|
169307
|
+
}
|
|
169308
|
+
return argumentIndex;
|
|
169309
|
+
}
|
|
169283
169310
|
if (isSpreadElement(child)) {
|
|
169284
|
-
|
|
169311
|
+
argumentIndex += getSpreadElementCount(child, checker);
|
|
169312
|
+
skipComma = true;
|
|
169313
|
+
continue;
|
|
169285
169314
|
}
|
|
169315
|
+
if (child.kind !== 28 /* CommaToken */) {
|
|
169316
|
+
argumentIndex++;
|
|
169317
|
+
skipComma = true;
|
|
169318
|
+
continue;
|
|
169319
|
+
}
|
|
169320
|
+
if (skipComma) {
|
|
169321
|
+
skipComma = false;
|
|
169322
|
+
continue;
|
|
169323
|
+
}
|
|
169324
|
+
argumentIndex++;
|
|
169286
169325
|
}
|
|
169287
|
-
|
|
169288
|
-
|
|
169289
|
-
argumentCount++;
|
|
169326
|
+
if (node) {
|
|
169327
|
+
return argumentIndex;
|
|
169290
169328
|
}
|
|
169291
|
-
return
|
|
169329
|
+
return args.length && last(args).kind === 28 /* CommaToken */ ? argumentIndex + 1 : argumentIndex;
|
|
169292
169330
|
}
|
|
169293
169331
|
function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) {
|
|
169294
169332
|
Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node.");
|
|
@@ -181088,7 +181126,16 @@ function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) {
|
|
|
181088
181126
|
recursive ? watchedDirectoriesRecursive : watchedDirectories,
|
|
181089
181127
|
path,
|
|
181090
181128
|
callback,
|
|
181091
|
-
(id) => ({
|
|
181129
|
+
(id) => ({
|
|
181130
|
+
eventName: CreateDirectoryWatcherEvent,
|
|
181131
|
+
data: {
|
|
181132
|
+
id,
|
|
181133
|
+
path,
|
|
181134
|
+
recursive: !!recursive,
|
|
181135
|
+
// Special case node_modules as we watch it for changes to closed script infos as well
|
|
181136
|
+
ignoreUpdate: !path.endsWith("/node_modules") ? true : void 0
|
|
181137
|
+
}
|
|
181138
|
+
})
|
|
181092
181139
|
);
|
|
181093
181140
|
}
|
|
181094
181141
|
function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) {
|
|
@@ -181115,24 +181162,28 @@ function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) {
|
|
|
181115
181162
|
}
|
|
181116
181163
|
};
|
|
181117
181164
|
}
|
|
181118
|
-
function onWatchChange(
|
|
181119
|
-
|
|
181120
|
-
|
|
181121
|
-
|
|
181165
|
+
function onWatchChange(args) {
|
|
181166
|
+
if (isArray(args))
|
|
181167
|
+
args.forEach(onWatchChangeRequestArgs);
|
|
181168
|
+
else
|
|
181169
|
+
onWatchChangeRequestArgs(args);
|
|
181122
181170
|
}
|
|
181123
|
-
function
|
|
181124
|
-
|
|
181125
|
-
(
|
|
181126
|
-
|
|
181127
|
-
callback(eventPath, eventKind);
|
|
181128
|
-
});
|
|
181171
|
+
function onWatchChangeRequestArgs({ id, created, deleted, updated }) {
|
|
181172
|
+
onWatchEventType(id, created, 0 /* Created */);
|
|
181173
|
+
onWatchEventType(id, deleted, 2 /* Deleted */);
|
|
181174
|
+
onWatchEventType(id, updated, 1 /* Changed */);
|
|
181129
181175
|
}
|
|
181130
|
-
function
|
|
181131
|
-
|
|
181132
|
-
if (eventType === "update")
|
|
181176
|
+
function onWatchEventType(id, paths, eventKind) {
|
|
181177
|
+
if (!(paths == null ? void 0 : paths.length))
|
|
181133
181178
|
return;
|
|
181134
|
-
(
|
|
181135
|
-
|
|
181179
|
+
forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind));
|
|
181180
|
+
forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath));
|
|
181181
|
+
forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath));
|
|
181182
|
+
}
|
|
181183
|
+
function forEachCallback(hostWatcherMap, id, eventPaths, cb) {
|
|
181184
|
+
var _a;
|
|
181185
|
+
(_a = hostWatcherMap.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
|
|
181186
|
+
eventPaths.forEach((eventPath) => cb(callback, normalizeSlashes(eventPath)));
|
|
181136
181187
|
});
|
|
181137
181188
|
}
|
|
181138
181189
|
}
|
package/lib/typescript.d.ts
CHANGED
|
@@ -1510,12 +1510,13 @@ declare namespace ts {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
interface WatchChangeRequest extends Request {
|
|
1512
1512
|
command: CommandTypes.WatchChange;
|
|
1513
|
-
arguments: WatchChangeRequestArgs;
|
|
1513
|
+
arguments: WatchChangeRequestArgs | readonly WatchChangeRequestArgs[];
|
|
1514
1514
|
}
|
|
1515
1515
|
interface WatchChangeRequestArgs {
|
|
1516
1516
|
id: number;
|
|
1517
|
-
|
|
1518
|
-
|
|
1517
|
+
created?: string[];
|
|
1518
|
+
deleted?: string[];
|
|
1519
|
+
updated?: string[];
|
|
1519
1520
|
}
|
|
1520
1521
|
/**
|
|
1521
1522
|
* Request to obtain the list of files that should be regenerated if target file is recompiled.
|
|
@@ -2452,6 +2453,7 @@ declare namespace ts {
|
|
|
2452
2453
|
readonly id: number;
|
|
2453
2454
|
readonly path: string;
|
|
2454
2455
|
readonly recursive: boolean;
|
|
2456
|
+
readonly ignoreUpdate?: boolean;
|
|
2455
2457
|
}
|
|
2456
2458
|
type CloseFileWatcherEventName = "closeFileWatcher";
|
|
2457
2459
|
interface CloseFileWatcherEvent extends Event {
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = "5.4.
|
|
38
|
+
version = "5.4.5";
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -5423,14 +5423,17 @@ ${lanes.join("\n")}
|
|
|
5423
5423
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
|
5424
5424
|
}
|
|
5425
5425
|
}
|
|
5426
|
-
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
|
5426
|
+
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) {
|
|
5427
5427
|
const fileWatcherCallbacks = createMultiMap();
|
|
5428
|
+
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
|
|
5428
5429
|
const dirWatchers = /* @__PURE__ */ new Map();
|
|
5429
5430
|
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
5430
5431
|
return nonPollingWatchFile;
|
|
5431
5432
|
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
|
5432
5433
|
const filePath = toCanonicalName(fileName);
|
|
5433
|
-
fileWatcherCallbacks.add(filePath, callback)
|
|
5434
|
+
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
|
|
5435
|
+
fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime);
|
|
5436
|
+
}
|
|
5434
5437
|
const dirPath = getDirectoryPath(filePath) || ".";
|
|
5435
5438
|
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
|
|
5436
5439
|
watcher.referenceCount++;
|
|
@@ -5450,14 +5453,31 @@ ${lanes.join("\n")}
|
|
|
5450
5453
|
const watcher = fsWatch(
|
|
5451
5454
|
dirName,
|
|
5452
5455
|
1 /* Directory */,
|
|
5453
|
-
(
|
|
5456
|
+
(eventName, relativeFileName) => {
|
|
5454
5457
|
if (!isString(relativeFileName))
|
|
5455
5458
|
return;
|
|
5456
5459
|
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
|
|
5457
|
-
const
|
|
5460
|
+
const filePath = toCanonicalName(fileName);
|
|
5461
|
+
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
|
|
5458
5462
|
if (callbacks) {
|
|
5463
|
+
let currentModifiedTime;
|
|
5464
|
+
let eventKind = 1 /* Changed */;
|
|
5465
|
+
if (fileTimestamps) {
|
|
5466
|
+
const existingTime = fileTimestamps.get(filePath);
|
|
5467
|
+
if (eventName === "change") {
|
|
5468
|
+
currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime;
|
|
5469
|
+
if (currentModifiedTime.getTime() === existingTime.getTime())
|
|
5470
|
+
return;
|
|
5471
|
+
}
|
|
5472
|
+
currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime);
|
|
5473
|
+
fileTimestamps.set(filePath, currentModifiedTime);
|
|
5474
|
+
if (existingTime === missingFileModifiedTime)
|
|
5475
|
+
eventKind = 0 /* Created */;
|
|
5476
|
+
else if (currentModifiedTime === missingFileModifiedTime)
|
|
5477
|
+
eventKind = 2 /* Deleted */;
|
|
5478
|
+
}
|
|
5459
5479
|
for (const fileCallback of callbacks) {
|
|
5460
|
-
fileCallback(fileName,
|
|
5480
|
+
fileCallback(fileName, eventKind, currentModifiedTime);
|
|
5461
5481
|
}
|
|
5462
5482
|
}
|
|
5463
5483
|
},
|
|
@@ -5849,7 +5869,7 @@ ${lanes.join("\n")}
|
|
|
5849
5869
|
);
|
|
5850
5870
|
case 5 /* UseFsEventsOnParentDirectory */:
|
|
5851
5871
|
if (!nonPollingWatchFile) {
|
|
5852
|
-
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
|
5872
|
+
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp);
|
|
5853
5873
|
}
|
|
5854
5874
|
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
|
5855
5875
|
default:
|
|
@@ -6024,7 +6044,7 @@ ${lanes.join("\n")}
|
|
|
6024
6044
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
6025
6045
|
}
|
|
6026
6046
|
try {
|
|
6027
|
-
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
6047
|
+
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
6028
6048
|
fileOrDirectory,
|
|
6029
6049
|
recursive,
|
|
6030
6050
|
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
|
|
@@ -45450,13 +45470,21 @@ ${lanes.join("\n")}
|
|
|
45450
45470
|
}
|
|
45451
45471
|
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
|
|
45452
45472
|
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
|
|
45453
|
-
|
|
45473
|
+
const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
|
|
45474
|
+
if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
|
|
45454
45475
|
return maybeNonRelative;
|
|
45455
45476
|
}
|
|
45456
45477
|
return relativePath;
|
|
45457
45478
|
}
|
|
45458
45479
|
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
|
|
45459
45480
|
}
|
|
45481
|
+
function packageJsonPathsAreEqual(a, b, ignoreCase) {
|
|
45482
|
+
if (a === b)
|
|
45483
|
+
return true;
|
|
45484
|
+
if (a === void 0 || b === void 0)
|
|
45485
|
+
return false;
|
|
45486
|
+
return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
|
|
45487
|
+
}
|
|
45460
45488
|
function countPathComponents(path) {
|
|
45461
45489
|
let count = 0;
|
|
45462
45490
|
for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
|
|
@@ -50495,15 +50523,19 @@ ${lanes.join("\n")}
|
|
|
50495
50523
|
return true;
|
|
50496
50524
|
}
|
|
50497
50525
|
}
|
|
50498
|
-
function
|
|
50526
|
+
function getMeaningOfEntityNameReference(entityName) {
|
|
50499
50527
|
let meaning;
|
|
50500
50528
|
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */) {
|
|
50501
50529
|
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
50502
|
-
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */) {
|
|
50530
|
+
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
|
|
50503
50531
|
meaning = 1920 /* Namespace */;
|
|
50504
50532
|
} else {
|
|
50505
50533
|
meaning = 788968 /* Type */;
|
|
50506
50534
|
}
|
|
50535
|
+
return meaning;
|
|
50536
|
+
}
|
|
50537
|
+
function isEntityNameVisible(entityName, enclosingDeclaration) {
|
|
50538
|
+
const meaning = getMeaningOfEntityNameReference(entityName);
|
|
50507
50539
|
const firstIdentifier = getFirstIdentifier(entityName);
|
|
50508
50540
|
const symbol = resolveName(
|
|
50509
50541
|
enclosingDeclaration,
|
|
@@ -52564,9 +52596,10 @@ ${lanes.join("\n")}
|
|
|
52564
52596
|
introducesError = true;
|
|
52565
52597
|
return { introducesError, node };
|
|
52566
52598
|
}
|
|
52599
|
+
const meaning = getMeaningOfEntityNameReference(node);
|
|
52567
52600
|
const sym = resolveEntityName(
|
|
52568
52601
|
leftmost,
|
|
52569
|
-
|
|
52602
|
+
meaning,
|
|
52570
52603
|
/*ignoreErrors*/
|
|
52571
52604
|
true,
|
|
52572
52605
|
/*dontResolveAlias*/
|
|
@@ -52576,13 +52609,13 @@ ${lanes.join("\n")}
|
|
|
52576
52609
|
if (isSymbolAccessible(
|
|
52577
52610
|
sym,
|
|
52578
52611
|
context.enclosingDeclaration,
|
|
52579
|
-
|
|
52612
|
+
meaning,
|
|
52580
52613
|
/*shouldComputeAliasesToMakeVisible*/
|
|
52581
52614
|
false
|
|
52582
52615
|
).accessibility !== 0 /* Accessible */) {
|
|
52583
52616
|
introducesError = true;
|
|
52584
52617
|
} else {
|
|
52585
|
-
context.tracker.trackSymbol(sym, context.enclosingDeclaration,
|
|
52618
|
+
context.tracker.trackSymbol(sym, context.enclosingDeclaration, meaning);
|
|
52586
52619
|
includePrivateSymbol == null ? void 0 : includePrivateSymbol(sym);
|
|
52587
52620
|
}
|
|
52588
52621
|
if (isIdentifier(node)) {
|
|
@@ -57810,12 +57843,10 @@ ${lanes.join("\n")}
|
|
|
57810
57843
|
const target = type.target ?? type;
|
|
57811
57844
|
const typeVariable = getHomomorphicTypeVariable(target);
|
|
57812
57845
|
if (typeVariable && !target.declaration.nameType) {
|
|
57813
|
-
const
|
|
57814
|
-
|
|
57815
|
-
|
|
57816
|
-
|
|
57817
|
-
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
57818
|
-
}
|
|
57846
|
+
const modifiersType = getModifiersTypeFromMappedType(type);
|
|
57847
|
+
const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType);
|
|
57848
|
+
if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
|
|
57849
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
57819
57850
|
}
|
|
57820
57851
|
}
|
|
57821
57852
|
return type;
|
|
@@ -57976,13 +58007,13 @@ ${lanes.join("\n")}
|
|
|
57976
58007
|
}
|
|
57977
58008
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
57978
58009
|
var _a, _b, _c;
|
|
57979
|
-
let property = (
|
|
58010
|
+
let property = skipObjectFunctionPropertyAugment ? (_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name) : (_b = type.propertyCache) == null ? void 0 : _b.get(name);
|
|
57980
58011
|
if (!property) {
|
|
57981
58012
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
57982
58013
|
if (property) {
|
|
57983
58014
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
57984
58015
|
properties.set(name, property);
|
|
57985
|
-
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
58016
|
+
if (skipObjectFunctionPropertyAugment && !(getCheckFlags(property) & 48 /* Partial */) && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
57986
58017
|
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
57987
58018
|
properties2.set(name, property);
|
|
57988
58019
|
}
|
|
@@ -60489,6 +60520,9 @@ ${lanes.join("\n")}
|
|
|
60489
60520
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
60490
60521
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
60491
60522
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
60523
|
+
} else if (typeSet.length >= 4) {
|
|
60524
|
+
const middle = Math.floor(typeSet.length / 2);
|
|
60525
|
+
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
|
|
60492
60526
|
} else {
|
|
60493
60527
|
if (!checkCrossProductUnion(typeSet)) {
|
|
60494
60528
|
return errorType;
|
|
@@ -159646,7 +159680,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159646
159680
|
}
|
|
159647
159681
|
function symbolAppearsToBeTypeOnly(symbol) {
|
|
159648
159682
|
var _a;
|
|
159649
|
-
|
|
159683
|
+
const flags = getCombinedLocalAndExportSymbolFlags(skipAlias(symbol, typeChecker));
|
|
159684
|
+
return !(flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(flags & 788968 /* Type */));
|
|
159650
159685
|
}
|
|
159651
159686
|
}
|
|
159652
159687
|
function getLabelCompletionAtPosition(node) {
|
|
@@ -159942,10 +159977,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159942
159977
|
return isJsxExpression(parent2) && !isJsxElement(parent2.parent) && !isJsxFragment(parent2.parent) ? checker.getContextualTypeForJsxAttribute(parent2.parent) : void 0;
|
|
159943
159978
|
default:
|
|
159944
159979
|
const argInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(previousToken, position, sourceFile, checker);
|
|
159945
|
-
return argInfo ? (
|
|
159946
|
-
// At `,`, treat this as the next argument after the comma.
|
|
159947
|
-
checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === 28 /* CommaToken */ ? 1 : 0))
|
|
159948
|
-
) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
|
|
159980
|
+
return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
|
|
159949
159981
|
// completion at `x ===/**/` should be for the right side
|
|
159950
159982
|
checker.getTypeAtLocation(parent2.left)
|
|
159951
159983
|
) : checker.getContextualType(previousToken, 4 /* Completions */) || checker.getContextualType(previousToken);
|
|
@@ -168509,12 +168541,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168509
168541
|
if (!info)
|
|
168510
168542
|
return void 0;
|
|
168511
168543
|
const { list, argumentIndex } = info;
|
|
168512
|
-
const argumentCount = getArgumentCount(
|
|
168513
|
-
list,
|
|
168514
|
-
/*ignoreTrailingComma*/
|
|
168515
|
-
isInString(sourceFile, position, node),
|
|
168516
|
-
checker
|
|
168517
|
-
);
|
|
168544
|
+
const argumentCount = getArgumentCount(checker, list);
|
|
168518
168545
|
if (argumentIndex !== 0) {
|
|
168519
168546
|
Debug.assertLessThan(argumentIndex, argumentCount);
|
|
168520
168547
|
}
|
|
@@ -168526,7 +168553,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168526
168553
|
return { list: getChildListThatStartsWithOpenerToken(node.parent, node, sourceFile), argumentIndex: 0 };
|
|
168527
168554
|
} else {
|
|
168528
168555
|
const list = findContainingList(node);
|
|
168529
|
-
return list && { list, argumentIndex: getArgumentIndex(list, node
|
|
168556
|
+
return list && { list, argumentIndex: getArgumentIndex(checker, list, node) };
|
|
168530
168557
|
}
|
|
168531
168558
|
}
|
|
168532
168559
|
function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker) {
|
|
@@ -168656,24 +168683,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168656
168683
|
return isFunctionTypeNode(d) ? (_a = tryCast(d.parent, canHaveSymbol)) == null ? void 0 : _a.symbol : void 0;
|
|
168657
168684
|
}) || s : s;
|
|
168658
168685
|
}
|
|
168659
|
-
function getArgumentIndex(argumentsList, node, checker) {
|
|
168660
|
-
const args = argumentsList.getChildren();
|
|
168661
|
-
let argumentIndex = 0;
|
|
168662
|
-
for (let pos = 0; pos < length(args); pos++) {
|
|
168663
|
-
const child = args[pos];
|
|
168664
|
-
if (child === node) {
|
|
168665
|
-
break;
|
|
168666
|
-
}
|
|
168667
|
-
if (isSpreadElement(child)) {
|
|
168668
|
-
argumentIndex = argumentIndex + getSpreadElementCount(child, checker) + (pos > 0 ? pos : 0);
|
|
168669
|
-
} else {
|
|
168670
|
-
if (child.kind !== 28 /* CommaToken */) {
|
|
168671
|
-
argumentIndex++;
|
|
168672
|
-
}
|
|
168673
|
-
}
|
|
168674
|
-
}
|
|
168675
|
-
return argumentIndex;
|
|
168676
|
-
}
|
|
168677
168686
|
function getSpreadElementCount(node, checker) {
|
|
168678
168687
|
const spreadType = checker.getTypeAtLocation(node.expression);
|
|
168679
168688
|
if (checker.isTupleType(spreadType)) {
|
|
@@ -168686,19 +168695,48 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168686
168695
|
}
|
|
168687
168696
|
return 0;
|
|
168688
168697
|
}
|
|
168689
|
-
function
|
|
168690
|
-
|
|
168691
|
-
|
|
168692
|
-
|
|
168698
|
+
function getArgumentIndex(checker, argumentsList, node) {
|
|
168699
|
+
return getArgumentIndexOrCount(checker, argumentsList, node);
|
|
168700
|
+
}
|
|
168701
|
+
function getArgumentCount(checker, argumentsList) {
|
|
168702
|
+
return getArgumentIndexOrCount(
|
|
168703
|
+
checker,
|
|
168704
|
+
argumentsList,
|
|
168705
|
+
/*node*/
|
|
168706
|
+
void 0
|
|
168707
|
+
);
|
|
168708
|
+
}
|
|
168709
|
+
function getArgumentIndexOrCount(checker, argumentsList, node) {
|
|
168710
|
+
const args = argumentsList.getChildren();
|
|
168711
|
+
let argumentIndex = 0;
|
|
168712
|
+
let skipComma = false;
|
|
168713
|
+
for (const child of args) {
|
|
168714
|
+
if (node && child === node) {
|
|
168715
|
+
if (!skipComma && child.kind === 28 /* CommaToken */) {
|
|
168716
|
+
argumentIndex++;
|
|
168717
|
+
}
|
|
168718
|
+
return argumentIndex;
|
|
168719
|
+
}
|
|
168693
168720
|
if (isSpreadElement(child)) {
|
|
168694
|
-
|
|
168721
|
+
argumentIndex += getSpreadElementCount(child, checker);
|
|
168722
|
+
skipComma = true;
|
|
168723
|
+
continue;
|
|
168695
168724
|
}
|
|
168725
|
+
if (child.kind !== 28 /* CommaToken */) {
|
|
168726
|
+
argumentIndex++;
|
|
168727
|
+
skipComma = true;
|
|
168728
|
+
continue;
|
|
168729
|
+
}
|
|
168730
|
+
if (skipComma) {
|
|
168731
|
+
skipComma = false;
|
|
168732
|
+
continue;
|
|
168733
|
+
}
|
|
168734
|
+
argumentIndex++;
|
|
168696
168735
|
}
|
|
168697
|
-
|
|
168698
|
-
|
|
168699
|
-
argumentCount++;
|
|
168736
|
+
if (node) {
|
|
168737
|
+
return argumentIndex;
|
|
168700
168738
|
}
|
|
168701
|
-
return
|
|
168739
|
+
return args.length && last(args).kind === 28 /* CommaToken */ ? argumentIndex + 1 : argumentIndex;
|
|
168702
168740
|
}
|
|
168703
168741
|
function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) {
|
|
168704
168742
|
Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node.");
|
|
@@ -178286,7 +178324,16 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
178286
178324
|
recursive ? watchedDirectoriesRecursive : watchedDirectories,
|
|
178287
178325
|
path,
|
|
178288
178326
|
callback,
|
|
178289
|
-
(id) => ({
|
|
178327
|
+
(id) => ({
|
|
178328
|
+
eventName: CreateDirectoryWatcherEvent,
|
|
178329
|
+
data: {
|
|
178330
|
+
id,
|
|
178331
|
+
path,
|
|
178332
|
+
recursive: !!recursive,
|
|
178333
|
+
// Special case node_modules as we watch it for changes to closed script infos as well
|
|
178334
|
+
ignoreUpdate: !path.endsWith("/node_modules") ? true : void 0
|
|
178335
|
+
}
|
|
178336
|
+
})
|
|
178290
178337
|
);
|
|
178291
178338
|
}
|
|
178292
178339
|
function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) {
|
|
@@ -178313,24 +178360,28 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
178313
178360
|
}
|
|
178314
178361
|
};
|
|
178315
178362
|
}
|
|
178316
|
-
function onWatchChange(
|
|
178317
|
-
|
|
178318
|
-
|
|
178319
|
-
|
|
178363
|
+
function onWatchChange(args) {
|
|
178364
|
+
if (isArray(args))
|
|
178365
|
+
args.forEach(onWatchChangeRequestArgs);
|
|
178366
|
+
else
|
|
178367
|
+
onWatchChangeRequestArgs(args);
|
|
178320
178368
|
}
|
|
178321
|
-
function
|
|
178322
|
-
|
|
178323
|
-
(
|
|
178324
|
-
|
|
178325
|
-
callback(eventPath, eventKind);
|
|
178326
|
-
});
|
|
178369
|
+
function onWatchChangeRequestArgs({ id, created, deleted, updated }) {
|
|
178370
|
+
onWatchEventType(id, created, 0 /* Created */);
|
|
178371
|
+
onWatchEventType(id, deleted, 2 /* Deleted */);
|
|
178372
|
+
onWatchEventType(id, updated, 1 /* Changed */);
|
|
178327
178373
|
}
|
|
178328
|
-
function
|
|
178329
|
-
|
|
178330
|
-
if (eventType === "update")
|
|
178374
|
+
function onWatchEventType(id, paths, eventKind) {
|
|
178375
|
+
if (!(paths == null ? void 0 : paths.length))
|
|
178331
178376
|
return;
|
|
178332
|
-
(
|
|
178333
|
-
|
|
178377
|
+
forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind));
|
|
178378
|
+
forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath));
|
|
178379
|
+
forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath));
|
|
178380
|
+
}
|
|
178381
|
+
function forEachCallback(hostWatcherMap, id, eventPaths, cb) {
|
|
178382
|
+
var _a;
|
|
178383
|
+
(_a = hostWatcherMap.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
|
|
178384
|
+
eventPaths.forEach((eventPath) => cb(callback, normalizeSlashes(eventPath)));
|
|
178334
178385
|
});
|
|
178335
178386
|
}
|
|
178336
178387
|
}
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.4";
|
|
57
|
-
var version = "5.4.
|
|
57
|
+
var version = "5.4.5";
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3560,14 +3560,17 @@ function createDynamicPriorityPollingWatchFile(host) {
|
|
|
3560
3560
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
|
3561
3561
|
}
|
|
3562
3562
|
}
|
|
3563
|
-
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
|
3563
|
+
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime2, fsWatchWithTimestamp) {
|
|
3564
3564
|
const fileWatcherCallbacks = createMultiMap();
|
|
3565
|
+
const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0;
|
|
3565
3566
|
const dirWatchers = /* @__PURE__ */ new Map();
|
|
3566
3567
|
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
3567
3568
|
return nonPollingWatchFile;
|
|
3568
3569
|
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
|
3569
3570
|
const filePath = toCanonicalName(fileName);
|
|
3570
|
-
fileWatcherCallbacks.add(filePath, callback)
|
|
3571
|
+
if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) {
|
|
3572
|
+
fileTimestamps.set(filePath, getModifiedTime2(fileName) || missingFileModifiedTime);
|
|
3573
|
+
}
|
|
3571
3574
|
const dirPath = getDirectoryPath(filePath) || ".";
|
|
3572
3575
|
const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions);
|
|
3573
3576
|
watcher.referenceCount++;
|
|
@@ -3587,14 +3590,31 @@ function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFi
|
|
|
3587
3590
|
const watcher = fsWatch(
|
|
3588
3591
|
dirName,
|
|
3589
3592
|
1 /* Directory */,
|
|
3590
|
-
(
|
|
3593
|
+
(eventName, relativeFileName) => {
|
|
3591
3594
|
if (!isString(relativeFileName))
|
|
3592
3595
|
return;
|
|
3593
3596
|
const fileName = getNormalizedAbsolutePath(relativeFileName, dirName);
|
|
3594
|
-
const
|
|
3597
|
+
const filePath = toCanonicalName(fileName);
|
|
3598
|
+
const callbacks = fileName && fileWatcherCallbacks.get(filePath);
|
|
3595
3599
|
if (callbacks) {
|
|
3600
|
+
let currentModifiedTime;
|
|
3601
|
+
let eventKind = 1 /* Changed */;
|
|
3602
|
+
if (fileTimestamps) {
|
|
3603
|
+
const existingTime = fileTimestamps.get(filePath);
|
|
3604
|
+
if (eventName === "change") {
|
|
3605
|
+
currentModifiedTime = getModifiedTime2(fileName) || missingFileModifiedTime;
|
|
3606
|
+
if (currentModifiedTime.getTime() === existingTime.getTime())
|
|
3607
|
+
return;
|
|
3608
|
+
}
|
|
3609
|
+
currentModifiedTime || (currentModifiedTime = getModifiedTime2(fileName) || missingFileModifiedTime);
|
|
3610
|
+
fileTimestamps.set(filePath, currentModifiedTime);
|
|
3611
|
+
if (existingTime === missingFileModifiedTime)
|
|
3612
|
+
eventKind = 0 /* Created */;
|
|
3613
|
+
else if (currentModifiedTime === missingFileModifiedTime)
|
|
3614
|
+
eventKind = 2 /* Deleted */;
|
|
3615
|
+
}
|
|
3596
3616
|
for (const fileCallback of callbacks) {
|
|
3597
|
-
fileCallback(fileName,
|
|
3617
|
+
fileCallback(fileName, eventKind, currentModifiedTime);
|
|
3598
3618
|
}
|
|
3599
3619
|
}
|
|
3600
3620
|
},
|
|
@@ -3985,7 +4005,7 @@ function createSystemWatchFunctions({
|
|
|
3985
4005
|
);
|
|
3986
4006
|
case 5 /* UseFsEventsOnParentDirectory */:
|
|
3987
4007
|
if (!nonPollingWatchFile) {
|
|
3988
|
-
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
|
4008
|
+
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime2, fsWatchWithTimestamp);
|
|
3989
4009
|
}
|
|
3990
4010
|
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
|
3991
4011
|
default:
|
|
@@ -4160,7 +4180,7 @@ function createSystemWatchFunctions({
|
|
|
4160
4180
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4161
4181
|
}
|
|
4162
4182
|
try {
|
|
4163
|
-
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
4183
|
+
const presentWatcher = (entryKind === 1 /* Directory */ || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
4164
4184
|
fileOrDirectory,
|
|
4165
4185
|
recursive,
|
|
4166
4186
|
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.
|
|
5
|
+
"version": "5.4.5",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|