typescript 5.1.0-dev.20230331 → 5.1.0-dev.20230401
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 +111 -79
- package/lib/tsserver.js +133 -83
- package/lib/tsserverlibrary.js +127 -83
- package/lib/typescript.js +121 -83
- package/lib/typingsInstaller.js +3 -2
- package/package.json +2 -2
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230401`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -18055,6 +18055,9 @@ ${lanes.join("\n")}
|
|
|
18055
18055
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
18056
18056
|
return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
18057
18057
|
}
|
|
18058
|
+
function shouldResolveJsRequire(compilerOptions) {
|
|
18059
|
+
return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
|
|
18060
|
+
}
|
|
18058
18061
|
function getResolvePackageJsonExports(compilerOptions) {
|
|
18059
18062
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
18060
18063
|
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
@@ -38030,7 +38033,8 @@ ${lanes.join("\n")}
|
|
|
38030
38033
|
affectsBuildInfo: true,
|
|
38031
38034
|
category: Diagnostics.Modules,
|
|
38032
38035
|
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
|
|
38033
|
-
defaultValueDescription: false
|
|
38036
|
+
defaultValueDescription: false,
|
|
38037
|
+
transpileOptionValue: void 0
|
|
38034
38038
|
},
|
|
38035
38039
|
{
|
|
38036
38040
|
name: "resolvePackageJsonExports",
|
|
@@ -43786,7 +43790,7 @@ ${lanes.join("\n")}
|
|
|
43786
43790
|
}
|
|
43787
43791
|
if (!isBindingPattern(node.name)) {
|
|
43788
43792
|
const possibleVariableDecl = node.kind === 258 /* VariableDeclaration */ ? node : node.parent.parent;
|
|
43789
|
-
if (isInJSFile(node) &&
|
|
43793
|
+
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
|
|
43790
43794
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
43791
43795
|
} else if (isBlockOrCatchScoped(node)) {
|
|
43792
43796
|
bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
|
|
@@ -47353,7 +47357,7 @@ ${lanes.join("\n")}
|
|
|
47353
47357
|
const hasDefaultOnly = isOnlyImportedAsDefault(specifier);
|
|
47354
47358
|
const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
|
|
47355
47359
|
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
47356
|
-
if (hasExportAssignmentSymbol(moduleSymbol) && !
|
|
47360
|
+
if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) {
|
|
47357
47361
|
const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
47358
47362
|
const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
|
|
47359
47363
|
const exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
@@ -47521,7 +47525,7 @@ ${lanes.join("\n")}
|
|
|
47521
47525
|
if (!isIdentifier(name)) {
|
|
47522
47526
|
return void 0;
|
|
47523
47527
|
}
|
|
47524
|
-
const suppressInteropError = name.escapedText === "default" /* Default */ &&
|
|
47528
|
+
const suppressInteropError = name.escapedText === "default" /* Default */ && allowSyntheticDefaultImports;
|
|
47525
47529
|
const targetSymbol = resolveESModuleSymbol(
|
|
47526
47530
|
moduleSymbol,
|
|
47527
47531
|
moduleSpecifier,
|
|
@@ -52163,7 +52167,7 @@ ${lanes.join("\n")}
|
|
|
52163
52167
|
return;
|
|
52164
52168
|
}
|
|
52165
52169
|
let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName);
|
|
52166
|
-
if (verbatimTargetName === "export=" /* ExportEquals */ &&
|
|
52170
|
+
if (verbatimTargetName === "export=" /* ExportEquals */ && allowSyntheticDefaultImports) {
|
|
52167
52171
|
verbatimTargetName = "default" /* Default */;
|
|
52168
52172
|
}
|
|
52169
52173
|
const targetName = getInternalSymbolName(target, verbatimTargetName);
|
|
@@ -73386,7 +73390,7 @@ ${lanes.join("\n")}
|
|
|
73386
73390
|
return anyType;
|
|
73387
73391
|
}
|
|
73388
73392
|
}
|
|
73389
|
-
if (isInJSFile(node) &&
|
|
73393
|
+
if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) {
|
|
73390
73394
|
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
|
|
73391
73395
|
}
|
|
73392
73396
|
const returnType = getReturnTypeOfSignature(signature);
|
|
@@ -117571,7 +117575,7 @@ ${lanes.join("\n")}
|
|
|
117571
117575
|
false
|
|
117572
117576
|
);
|
|
117573
117577
|
}
|
|
117574
|
-
const shouldProcessRequires = isJavaScriptFile &&
|
|
117578
|
+
const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options);
|
|
117575
117579
|
if (file.flags & 2097152 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) {
|
|
117576
117580
|
collectDynamicImportOrRequireCalls(file);
|
|
117577
117581
|
}
|
|
@@ -121171,6 +121175,79 @@ ${lanes.join("\n")}
|
|
|
121171
121175
|
}
|
|
121172
121176
|
return true;
|
|
121173
121177
|
}
|
|
121178
|
+
function canWatchAtTypes(atTypes, rootPath) {
|
|
121179
|
+
const dirPath = getDirectoryPath(getDirectoryPath(atTypes));
|
|
121180
|
+
return dirPath === rootPath || canWatchDirectoryOrFile(dirPath);
|
|
121181
|
+
}
|
|
121182
|
+
function isInDirectoryPath(dir, file) {
|
|
121183
|
+
if (dir === void 0 || file.length <= dir.length) {
|
|
121184
|
+
return false;
|
|
121185
|
+
}
|
|
121186
|
+
return startsWith(file, dir) && file[dir.length] === directorySeparator;
|
|
121187
|
+
}
|
|
121188
|
+
function canWatchAffectingLocation(filePath) {
|
|
121189
|
+
return canWatchDirectoryOrFile(filePath);
|
|
121190
|
+
}
|
|
121191
|
+
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootSplitLength, getCurrentDirectory) {
|
|
121192
|
+
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
|
|
121193
|
+
failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
121194
|
+
const failedLookupPathSplit = failedLookupLocationPath.split(directorySeparator);
|
|
121195
|
+
const failedLookupSplit = failedLookupLocation.split(directorySeparator);
|
|
121196
|
+
Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`);
|
|
121197
|
+
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
121198
|
+
return {
|
|
121199
|
+
dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(directorySeparator),
|
|
121200
|
+
dirPath: failedLookupPathSplit.slice(0, rootSplitLength + 1).join(directorySeparator)
|
|
121201
|
+
};
|
|
121202
|
+
} else {
|
|
121203
|
+
return {
|
|
121204
|
+
dir: rootDir,
|
|
121205
|
+
dirPath: rootPath,
|
|
121206
|
+
nonRecursive: false
|
|
121207
|
+
};
|
|
121208
|
+
}
|
|
121209
|
+
}
|
|
121210
|
+
return getDirectoryToWatchFromFailedLookupLocationDirectory(
|
|
121211
|
+
getDirectoryPath(getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())),
|
|
121212
|
+
getDirectoryPath(failedLookupLocationPath),
|
|
121213
|
+
rootPath
|
|
121214
|
+
);
|
|
121215
|
+
}
|
|
121216
|
+
function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath, rootPath) {
|
|
121217
|
+
while (pathContainsNodeModules(dirPath)) {
|
|
121218
|
+
dir = getDirectoryPath(dir);
|
|
121219
|
+
dirPath = getDirectoryPath(dirPath);
|
|
121220
|
+
}
|
|
121221
|
+
if (isNodeModulesDirectory(dirPath)) {
|
|
121222
|
+
return canWatchDirectoryOrFile(getDirectoryPath(dirPath)) ? { dir, dirPath } : void 0;
|
|
121223
|
+
}
|
|
121224
|
+
let nonRecursive = true;
|
|
121225
|
+
let subDirectoryPath, subDirectory;
|
|
121226
|
+
if (rootPath !== void 0) {
|
|
121227
|
+
while (!isInDirectoryPath(dirPath, rootPath)) {
|
|
121228
|
+
const parentPath = getDirectoryPath(dirPath);
|
|
121229
|
+
if (parentPath === dirPath) {
|
|
121230
|
+
break;
|
|
121231
|
+
}
|
|
121232
|
+
nonRecursive = false;
|
|
121233
|
+
subDirectoryPath = dirPath;
|
|
121234
|
+
subDirectory = dir;
|
|
121235
|
+
dirPath = parentPath;
|
|
121236
|
+
dir = getDirectoryPath(dir);
|
|
121237
|
+
}
|
|
121238
|
+
}
|
|
121239
|
+
return canWatchDirectoryOrFile(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive } : void 0;
|
|
121240
|
+
}
|
|
121241
|
+
function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, filterCustomPath) {
|
|
121242
|
+
if (isInDirectoryPath(rootPath, typeRootPath)) {
|
|
121243
|
+
return rootPath;
|
|
121244
|
+
}
|
|
121245
|
+
const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath, rootPath);
|
|
121246
|
+
return toWatch && filterCustomPath(toWatch.dirPath) ? toWatch.dirPath : void 0;
|
|
121247
|
+
}
|
|
121248
|
+
function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory) {
|
|
121249
|
+
return rootDirForResolution && removeTrailingDirectorySeparator(getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()));
|
|
121250
|
+
}
|
|
121174
121251
|
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
|
|
121175
121252
|
let filesWithChangedSetOfUnresolvedImports;
|
|
121176
121253
|
let filesWithInvalidatedResolutions;
|
|
@@ -121205,7 +121282,7 @@ ${lanes.join("\n")}
|
|
|
121205
121282
|
const customFailedLookupPaths = /* @__PURE__ */ new Map();
|
|
121206
121283
|
const directoryWatchesOfFailedLookups = /* @__PURE__ */ new Map();
|
|
121207
121284
|
const fileWatchesOfAffectingLocations = /* @__PURE__ */ new Map();
|
|
121208
|
-
const rootDir =
|
|
121285
|
+
const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory);
|
|
121209
121286
|
const rootPath = rootDir && resolutionHost.toPath(rootDir);
|
|
121210
121287
|
const rootSplitLength = rootPath !== void 0 ? rootPath.split(directorySeparator).length : 0;
|
|
121211
121288
|
const typeRootsWatches = /* @__PURE__ */ new Map();
|
|
@@ -121238,12 +121315,6 @@ ${lanes.join("\n")}
|
|
|
121238
121315
|
function getResolvedTypeReferenceDirective2(resolution) {
|
|
121239
121316
|
return resolution.resolvedTypeReferenceDirective;
|
|
121240
121317
|
}
|
|
121241
|
-
function isInDirectoryPath(dir, file) {
|
|
121242
|
-
if (dir === void 0 || file.length <= dir.length) {
|
|
121243
|
-
return false;
|
|
121244
|
-
}
|
|
121245
|
-
return startsWith(file, dir) && file[dir.length] === directorySeparator;
|
|
121246
|
-
}
|
|
121247
121318
|
function clear2() {
|
|
121248
121319
|
clearMap(directoryWatchesOfFailedLookups, closeFileWatcherOf);
|
|
121249
121320
|
clearMap(fileWatchesOfAffectingLocations, closeFileWatcherOf);
|
|
@@ -121527,55 +121598,6 @@ ${lanes.join("\n")}
|
|
|
121527
121598
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
121528
121599
|
return endsWith(dirPath, "/node_modules/@types");
|
|
121529
121600
|
}
|
|
121530
|
-
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath) {
|
|
121531
|
-
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
|
|
121532
|
-
failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
121533
|
-
const failedLookupPathSplit = failedLookupLocationPath.split(directorySeparator);
|
|
121534
|
-
const failedLookupSplit = failedLookupLocation.split(directorySeparator);
|
|
121535
|
-
Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`);
|
|
121536
|
-
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
121537
|
-
return {
|
|
121538
|
-
dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(directorySeparator),
|
|
121539
|
-
dirPath: failedLookupPathSplit.slice(0, rootSplitLength + 1).join(directorySeparator)
|
|
121540
|
-
};
|
|
121541
|
-
} else {
|
|
121542
|
-
return {
|
|
121543
|
-
dir: rootDir,
|
|
121544
|
-
dirPath: rootPath,
|
|
121545
|
-
nonRecursive: false
|
|
121546
|
-
};
|
|
121547
|
-
}
|
|
121548
|
-
}
|
|
121549
|
-
return getDirectoryToWatchFromFailedLookupLocationDirectory(
|
|
121550
|
-
getDirectoryPath(getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())),
|
|
121551
|
-
getDirectoryPath(failedLookupLocationPath)
|
|
121552
|
-
);
|
|
121553
|
-
}
|
|
121554
|
-
function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath) {
|
|
121555
|
-
while (pathContainsNodeModules(dirPath)) {
|
|
121556
|
-
dir = getDirectoryPath(dir);
|
|
121557
|
-
dirPath = getDirectoryPath(dirPath);
|
|
121558
|
-
}
|
|
121559
|
-
if (isNodeModulesDirectory(dirPath)) {
|
|
121560
|
-
return canWatchDirectoryOrFile(getDirectoryPath(dirPath)) ? { dir, dirPath } : void 0;
|
|
121561
|
-
}
|
|
121562
|
-
let nonRecursive = true;
|
|
121563
|
-
let subDirectoryPath, subDirectory;
|
|
121564
|
-
if (rootPath !== void 0) {
|
|
121565
|
-
while (!isInDirectoryPath(dirPath, rootPath)) {
|
|
121566
|
-
const parentPath = getDirectoryPath(dirPath);
|
|
121567
|
-
if (parentPath === dirPath) {
|
|
121568
|
-
break;
|
|
121569
|
-
}
|
|
121570
|
-
nonRecursive = false;
|
|
121571
|
-
subDirectoryPath = dirPath;
|
|
121572
|
-
subDirectory = dir;
|
|
121573
|
-
dirPath = parentPath;
|
|
121574
|
-
dir = getDirectoryPath(dir);
|
|
121575
|
-
}
|
|
121576
|
-
}
|
|
121577
|
-
return canWatchDirectoryOrFile(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive } : void 0;
|
|
121578
|
-
}
|
|
121579
121601
|
function isPathWithDefaultFailedLookupExtension(path) {
|
|
121580
121602
|
return fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
|
|
121581
121603
|
}
|
|
@@ -121614,7 +121636,14 @@ ${lanes.join("\n")}
|
|
|
121614
121636
|
if (failedLookupLocations) {
|
|
121615
121637
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
121616
121638
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
121617
|
-
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121639
|
+
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121640
|
+
failedLookupLocation,
|
|
121641
|
+
failedLookupLocationPath,
|
|
121642
|
+
rootDir,
|
|
121643
|
+
rootPath,
|
|
121644
|
+
rootSplitLength,
|
|
121645
|
+
getCurrentDirectory
|
|
121646
|
+
);
|
|
121618
121647
|
if (toWatch) {
|
|
121619
121648
|
const { dir, dirPath, nonRecursive } = toWatch;
|
|
121620
121649
|
if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
|
|
@@ -121682,7 +121711,7 @@ ${lanes.join("\n")}
|
|
|
121682
121711
|
}
|
|
121683
121712
|
const paths = /* @__PURE__ */ new Set();
|
|
121684
121713
|
paths.add(locationToWatch);
|
|
121685
|
-
let actualWatcher =
|
|
121714
|
+
let actualWatcher = canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
|
121686
121715
|
cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
121687
121716
|
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
|
|
121688
121717
|
paths.forEach((path) => {
|
|
@@ -121750,7 +121779,14 @@ ${lanes.join("\n")}
|
|
|
121750
121779
|
let removeAtRoot = false;
|
|
121751
121780
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
121752
121781
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
121753
|
-
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121782
|
+
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121783
|
+
failedLookupLocation,
|
|
121784
|
+
failedLookupLocationPath,
|
|
121785
|
+
rootDir,
|
|
121786
|
+
rootPath,
|
|
121787
|
+
rootSplitLength,
|
|
121788
|
+
getCurrentDirectory
|
|
121789
|
+
);
|
|
121754
121790
|
if (toWatch) {
|
|
121755
121791
|
const { dirPath } = toWatch;
|
|
121756
121792
|
const refCount = customFailedLookupPaths.get(failedLookupLocationPath);
|
|
@@ -121918,13 +121954,6 @@ ${lanes.join("\n")}
|
|
|
121918
121954
|
function closeTypeRootsWatch() {
|
|
121919
121955
|
clearMap(typeRootsWatches, closeFileWatcher);
|
|
121920
121956
|
}
|
|
121921
|
-
function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) {
|
|
121922
|
-
if (isInDirectoryPath(rootPath, typeRootPath)) {
|
|
121923
|
-
return rootPath;
|
|
121924
|
-
}
|
|
121925
|
-
const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath);
|
|
121926
|
-
return toWatch && directoryWatchesOfFailedLookups.has(toWatch.dirPath) ? toWatch.dirPath : void 0;
|
|
121927
|
-
}
|
|
121928
121957
|
function createTypeRootsWatch(typeRootPath, typeRoot) {
|
|
121929
121958
|
return canWatchTypeRootPath(typeRootPath) ? resolutionHost.watchTypeRootsDirectory(typeRoot, (fileOrDirectory) => {
|
|
121930
121959
|
const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);
|
|
@@ -121933,7 +121962,12 @@ ${lanes.join("\n")}
|
|
|
121933
121962
|
}
|
|
121934
121963
|
hasChangedAutomaticTypeDirectiveNames = true;
|
|
121935
121964
|
resolutionHost.onChangedAutomaticTypeDirectiveNames();
|
|
121936
|
-
const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(
|
|
121965
|
+
const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(
|
|
121966
|
+
typeRoot,
|
|
121967
|
+
typeRootPath,
|
|
121968
|
+
rootPath,
|
|
121969
|
+
(dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2)
|
|
121970
|
+
);
|
|
121937
121971
|
if (dirPath) {
|
|
121938
121972
|
scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
|
|
121939
121973
|
}
|
|
@@ -121959,12 +121993,10 @@ ${lanes.join("\n")}
|
|
|
121959
121993
|
closeTypeRootsWatch();
|
|
121960
121994
|
}
|
|
121961
121995
|
}
|
|
121962
|
-
function canWatchTypeRootPath(
|
|
121996
|
+
function canWatchTypeRootPath(typeRoot) {
|
|
121963
121997
|
if (resolutionHost.getCompilationSettings().typeRoots)
|
|
121964
121998
|
return true;
|
|
121965
|
-
|
|
121966
|
-
const dirPath = resolutionHost.toPath(dir);
|
|
121967
|
-
return dirPath === rootPath || canWatchDirectoryOrFile(dirPath);
|
|
121999
|
+
return canWatchAtTypes(resolutionHost.toPath(typeRoot), rootPath);
|
|
121968
122000
|
}
|
|
121969
122001
|
}
|
|
121970
122002
|
function resolutionIsSymlink(resolution) {
|
|
@@ -129047,7 +129079,7 @@ ${lanes.join("\n")}
|
|
|
129047
129079
|
// Adding or removing imports from node could change the outcome of that guess, so could change the suggestions list.
|
|
129048
129080
|
typeAcquisitionEnabled && consumesNodeCoreModules(oldSourceFile) !== consumesNodeCoreModules(newSourceFile) || // Module agumentation and ambient module changes can add or remove exports available to be auto-imported.
|
|
129049
129081
|
// Changes elsewhere in the file can change the *type* of an export in a module augmentation,
|
|
129050
|
-
// but type info is gathered in getCompletionEntryDetails, which doesn
|
|
129082
|
+
// but type info is gathered in getCompletionEntryDetails, which doesn't use the cache.
|
|
129051
129083
|
!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations) || !ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile)) {
|
|
129052
129084
|
cache.clear();
|
|
129053
129085
|
return true;
|
|
@@ -137812,7 +137844,7 @@ ${lanes.join("\n")}
|
|
|
137812
137844
|
function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker) {
|
|
137813
137845
|
const errorNode = isPropertyAccessExpression(reference.parent) ? reference.parent.name : isBinaryExpression(reference.parent) ? reference.parent : reference;
|
|
137814
137846
|
const diagnostic = find(diagnostics, (diagnostic2) => diagnostic2.start === errorNode.getStart(sourceFile) && diagnostic2.start + diagnostic2.length === errorNode.getEnd());
|
|
137815
|
-
return diagnostic && contains(errorCodes3, diagnostic.code) || // A Promise is usually not correct in a binary expression (it
|
|
137847
|
+
return diagnostic && contains(errorCodes3, diagnostic.code) || // A Promise is usually not correct in a binary expression (it's not valid
|
|
137816
137848
|
// in an arithmetic expression and an equality comparison seems unusual),
|
|
137817
137849
|
// but if the other side of the binary expression has an error, the side
|
|
137818
137850
|
// is typed `any` which will squash the error that would identify this
|
|
@@ -153769,7 +153801,7 @@ ${lanes.join("\n")}
|
|
|
153769
153801
|
*/
|
|
153770
153802
|
this.markSeenReExportRHS = nodeSeenTracker();
|
|
153771
153803
|
this.symbolIdToReferences = [];
|
|
153772
|
-
// Source file ID
|
|
153804
|
+
// Source file ID -> symbol ID -> Whether the symbol has been searched for in the source file.
|
|
153773
153805
|
this.sourceFileToSeenSymbols = [];
|
|
153774
153806
|
}
|
|
153775
153807
|
includesSourceFile(sourceFile) {
|
|
@@ -162913,7 +162945,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162913
162945
|
if (start !== end) {
|
|
162914
162946
|
const textSpan = createTextSpanFromBounds(start, end);
|
|
162915
162947
|
if (!selectionRange || // Skip ranges that are identical to the parent
|
|
162916
|
-
!textSpansEqual(textSpan, selectionRange.textSpan) && // Skip ranges that don
|
|
162948
|
+
!textSpansEqual(textSpan, selectionRange.textSpan) && // Skip ranges that don't contain the original position
|
|
162917
162949
|
textSpanIntersectsWithPosition(textSpan, pos)) {
|
|
162918
162950
|
selectionRange = { textSpan, ...selectionRange && { parent: selectionRange } };
|
|
162919
162951
|
}
|
|
@@ -179132,6 +179164,8 @@ ${e.message}`;
|
|
|
179132
179164
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
179133
179165
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
179134
179166
|
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
179167
|
+
canWatchAffectingLocation: () => canWatchAffectingLocation,
|
|
179168
|
+
canWatchAtTypes: () => canWatchAtTypes,
|
|
179135
179169
|
canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
|
|
179136
179170
|
cartesianProduct: () => cartesianProduct,
|
|
179137
179171
|
cast: () => cast,
|
|
@@ -179579,6 +179613,8 @@ ${e.message}`;
|
|
|
179579
179613
|
getDiagnosticText: () => getDiagnosticText,
|
|
179580
179614
|
getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan,
|
|
179581
179615
|
getDirectoryPath: () => getDirectoryPath,
|
|
179616
|
+
getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation,
|
|
179617
|
+
getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot,
|
|
179582
179618
|
getDocumentPositionMapper: () => getDocumentPositionMapper,
|
|
179583
179619
|
getESModuleInterop: () => getESModuleInterop,
|
|
179584
179620
|
getEditsForFileRename: () => getEditsForFileRename,
|
|
@@ -179848,6 +179884,7 @@ ${e.message}`;
|
|
|
179848
179884
|
getRestParameterElementType: () => getRestParameterElementType,
|
|
179849
179885
|
getRightMostAssignedExpression: () => getRightMostAssignedExpression,
|
|
179850
179886
|
getRootDeclaration: () => getRootDeclaration,
|
|
179887
|
+
getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache,
|
|
179851
179888
|
getRootLength: () => getRootLength,
|
|
179852
179889
|
getScriptKind: () => getScriptKind,
|
|
179853
179890
|
getScriptKindFromFileName: () => getScriptKindFromFileName,
|
|
@@ -180945,6 +180982,7 @@ ${e.message}`;
|
|
|
180945
180982
|
setValueDeclaration: () => setValueDeclaration,
|
|
180946
180983
|
shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension,
|
|
180947
180984
|
shouldPreserveConstEnums: () => shouldPreserveConstEnums,
|
|
180985
|
+
shouldResolveJsRequire: () => shouldResolveJsRequire,
|
|
180948
180986
|
shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules,
|
|
180949
180987
|
showModuleSpecifier: () => showModuleSpecifier,
|
|
180950
180988
|
signatureHasLiteralTypes: () => signatureHasLiteralTypes,
|
|
@@ -181491,6 +181529,8 @@ ${e.message}`;
|
|
|
181491
181529
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
181492
181530
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
181493
181531
|
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
181532
|
+
canWatchAffectingLocation: () => canWatchAffectingLocation,
|
|
181533
|
+
canWatchAtTypes: () => canWatchAtTypes,
|
|
181494
181534
|
canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
|
|
181495
181535
|
cartesianProduct: () => cartesianProduct,
|
|
181496
181536
|
cast: () => cast,
|
|
@@ -181938,6 +181978,8 @@ ${e.message}`;
|
|
|
181938
181978
|
getDiagnosticText: () => getDiagnosticText,
|
|
181939
181979
|
getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan,
|
|
181940
181980
|
getDirectoryPath: () => getDirectoryPath,
|
|
181981
|
+
getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation,
|
|
181982
|
+
getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot,
|
|
181941
181983
|
getDocumentPositionMapper: () => getDocumentPositionMapper,
|
|
181942
181984
|
getESModuleInterop: () => getESModuleInterop,
|
|
181943
181985
|
getEditsForFileRename: () => getEditsForFileRename,
|
|
@@ -182207,6 +182249,7 @@ ${e.message}`;
|
|
|
182207
182249
|
getRestParameterElementType: () => getRestParameterElementType,
|
|
182208
182250
|
getRightMostAssignedExpression: () => getRightMostAssignedExpression,
|
|
182209
182251
|
getRootDeclaration: () => getRootDeclaration,
|
|
182252
|
+
getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache,
|
|
182210
182253
|
getRootLength: () => getRootLength,
|
|
182211
182254
|
getScriptKind: () => getScriptKind,
|
|
182212
182255
|
getScriptKindFromFileName: () => getScriptKindFromFileName,
|
|
@@ -183304,6 +183347,7 @@ ${e.message}`;
|
|
|
183304
183347
|
setValueDeclaration: () => setValueDeclaration,
|
|
183305
183348
|
shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension,
|
|
183306
183349
|
shouldPreserveConstEnums: () => shouldPreserveConstEnums,
|
|
183350
|
+
shouldResolveJsRequire: () => shouldResolveJsRequire,
|
|
183307
183351
|
shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules,
|
|
183308
183352
|
showModuleSpecifier: () => showModuleSpecifier,
|
|
183309
183353
|
signatureHasLiteralTypes: () => signatureHasLiteralTypes,
|