mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'main' into packageJsonWatch
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user