Merge branch 'main' into packageJsonWatch

This commit is contained in:
Sheetal Nandi
2022-06-08 10:45:04 -07:00
3 changed files with 12 additions and 6 deletions
+10 -4
View File
@@ -86,7 +86,14 @@ namespace ts {
return { fileName: resolved.path, packageId: resolved.packageId };
}
function createResolvedModuleWithFailedLookupLocations(resolved: Resolved | undefined, isExternalLibraryImport: boolean | undefined, failedLookupLocations: string[], affectingLocations: string[], diagnostics: Diagnostic[], resultFromCache: ResolvedModuleWithFailedLookupLocations | undefined): ResolvedModuleWithFailedLookupLocations {
function createResolvedModuleWithFailedLookupLocations(
resolved: Resolved | undefined,
isExternalLibraryImport: boolean | undefined,
failedLookupLocations: string[],
affectingLocations: string[],
diagnostics: Diagnostic[],
resultFromCache: ResolvedModuleWithFailedLookupLocations | undefined
): ResolvedModuleWithFailedLookupLocations {
if (resultFromCache) {
resultFromCache.failedLookupLocations.push(...failedLookupLocations);
resultFromCache.affectingLocations.push(...affectingLocations);
@@ -2578,8 +2585,7 @@ namespace ts {
host,
traceEnabled,
failedLookupLocations,
affectingLocations,
packageJsonInfoCache: cache,
affectingLocations, packageJsonInfoCache: cache,
features: NodeResolutionFeatures.None,
conditions: [],
requestContainingDirectory: containingDirectory,
@@ -2652,7 +2658,7 @@ namespace ts {
features: NodeResolutionFeatures.None,
conditions: [],
requestContainingDirectory: undefined,
reportDiagnostic: diag => void diagnostics.push(diag)
reportDiagnostic: diag => void diagnostics.push(diag),
};
const resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false, /*cache*/ undefined, /*redirectedReference*/ undefined);
return createResolvedModuleWithFailedLookupLocations(
+1 -1
View File
@@ -6768,7 +6768,7 @@ namespace ts {
readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
readonly failedLookupLocations: string[];
/*@internal*/ readonly affectingLocations: string[];
/* @internal */ readonly resolutionDiagnostics: Diagnostic[]
/* @internal */ resolutionDiagnostics: Diagnostic[];
}
/* @internal */
+1 -1
View File
@@ -141,7 +141,7 @@ namespace ts {
checkResolvedModule(resolution.resolvedModule, createResolvedModule(moduleFile.name));
// expect three failed lookup location - attempt to load module as file with all supported extensions
assert.equal(resolution.failedLookupLocations.length, supportedTSExtensions[0].length);
// TODO
assert.deepEqual(resolution.affectingLocations, [packageJsonFileName]);
}
}