From 11866b49a40d856097a5b89162bb8be807ceb90c Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 4 Oct 2024 15:18:21 -0700 Subject: [PATCH] Handle effective type roots and type ref resolution sharing cache // TODO: update incremental tests to actually verify the cache --- src/compiler/moduleNameResolver.ts | 316 ++++- src/compiler/program.ts | 100 +- src/compiler/resolutionCache.ts | 15 +- src/compiler/sharedResolutionCache.ts | 61 +- src/compiler/tsbuildPublic.ts | 69 +- src/compiler/types.ts | 5 + src/compiler/watchPublic.ts | 20 + src/harness/incrementalUtils.ts | 71 +- src/server/editorServices.ts | 2 + src/server/project.ts | 42 +- src/services/services.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 - ...Ref-resolutions-only-one-with-typeRoots.js | 8 +- ...solutions-with-common-@types-with-types.js | 14 +- .../typeRef-resolutions-with-common-@types.js | 33 +- ...ith-typeRoots-unspecified-discrepancies.js | 1032 ----------------- ...ts-unspecified-with-types-discrepancies.js | 222 ---- ...s-with-typeRoots-unspecified-with-types.js | 42 +- ...-resolutions-with-typeRoots-unspecified.js | 135 +-- .../type-reference-resolutions-reuse.js | 3 +- .../resolutionCache/project-with-imports.js | 3 +- .../loads-missing-files-from-disk.js | 10 +- .../works-using-legacy-resolution-logic.js | 14 +- ...folders-for-default-configured-projects.js | 8 - ...-roots-affect-type-reference-directives.js | 34 +- .../resolutionCache/project-with-imports.js | 3 +- ...Ref-resolutions-only-one-with-typeRoots.js | 4 +- ...solutions-with-common-@types-with-types.js | 14 +- .../typeRef-resolutions-with-common-@types.js | 21 +- ...s-with-typeRoots-unspecified-with-types.js | 82 +- ...-resolutions-with-typeRoots-unspecified.js | 71 +- 31 files changed, 754 insertions(+), 1702 deletions(-) delete mode 100644 tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-discrepancies.js delete mode 100644 tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-with-types-discrepancies.js diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index ee3d526cb86b2..8189869941d4a 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -256,7 +256,7 @@ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink( } function updateResultFromCache( - resultFromCache: ResolvedModuleWithFailedLookupLocations, + resultFromCache: ResolvedModuleWithFailedLookupLocations | ResolvedTypeReferenceDirectiveWithFailedLookupLocations, failedLookupLocations: string[], affectingLocations: string[], diagnostics: Diagnostic[], @@ -527,6 +527,17 @@ export function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffecti } } +/** @internal */ +export function getEffectiveTypeRootsWithModuleResolutionHost( + options: CompilerOptions, + redirect: ResolvedProjectReference | undefined, + host: ModuleResolutionHost, +): readonly string[] | undefined { + return host.getEffectiveTypeRoots ? + host.getEffectiveTypeRoots(options, redirect) : + getEffectiveTypeRoots(options, host); +} + /** * Returns the path to every node_modules/@types directory from some ancestor directory. * Returns undefined if there are none. @@ -575,12 +586,15 @@ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string options = redirectedReference.commandLine.options; } - const containingDirectory = containingFile ? getDirectoryPath(containingFile) : undefined; - let result = containingDirectory ? cache?.getFromDirectoryCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference) : undefined; - if (!result && containingDirectory && !isExternalModuleNameRelative(typeReferenceDirectiveName)) { - result = cache?.getFromNonRelativeNameCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference); - } + const typeRootsCacheKey = host.getTypeRootsCacheKey ? + host.getTypeRootsCacheKey(options, redirectedReference) : + createTypeRootsCacheKey(options, redirectedReference, host); + const containingDirectory = containingFile ? getDirectoryPath(containingFile) : undefined; + // Cache is already equired to handle specified typeRoots - and only guaranteed to have in perDirectoryCache + let result = options.typeRoots && containingDirectory ? + lookFromPerDirectoryCache(containingDirectory) : + undefined; if (result) { if (traceEnabled) { trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile); @@ -591,7 +605,7 @@ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string return result; } - const typeRoots = getEffectiveTypeRoots(options, host); + const typeRoots = getEffectiveTypeRootsWithModuleResolutionHost(options, redirectedReference, host); if (traceEnabled) { if (containingFile === undefined) { if (typeRoots === undefined) { @@ -646,6 +660,7 @@ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string resolvedPackageDirectory: false, }; let resolved = primaryLookup(); + if (result) return setResultInCacheAndResult(result); let primary = true; if (!resolved) { resolved = secondaryLookup(); @@ -671,17 +686,8 @@ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string affectingLocations: initializeResolutionField(affectingLocations), resolutionDiagnostics: initializeResolutionField(diagnostics), }; - if (containingDirectory) { - cache?.setPerDirectoryAndNonRelativeNameCacheResult( - typeReferenceDirectiveName, - resolutionMode, - containingDirectory, - redirectedReference, - result, - ); - } - if (traceEnabled) traceResult(result); - return result; + + return setResultInCacheAndResult(result); function traceResult(result: ResolvedTypeReferenceDirectiveWithFailedLookupLocations) { if (!result.resolvedTypeReferenceDirective?.resolvedFileName) { @@ -695,13 +701,80 @@ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string } } - function primaryLookup(): PathAndPackageId | undefined { + function setResultInCacheAndResult(result: ResolvedTypeReferenceDirectiveWithFailedLookupLocations) { + if (containingDirectory) { + cache?.setPerDirectoryAndNonRelativeNameCacheResult( + typeReferenceDirectiveName, + resolutionMode, + containingDirectory, + redirectedReference, + typeRootsCacheKey, + result, + ); + } + if (traceEnabled) traceResult(result); + return result; + } + + function lookFromPerDirectoryCache(directory: string) { + return directory === containingDirectory ? + cache?.getFromDirectoryCache( + typeReferenceDirectiveName, + resolutionMode, + containingDirectory, + redirectedReference, + typeRootsCacheKey, + ) : undefined; + } + + function lookupFromCache(directory: string) { + return lookFromPerDirectoryCache(directory) ?? ( + !isExternalModuleNameRelative(typeReferenceDirectiveName) ? + cache?.getFromNonRelativeNameCache( + typeReferenceDirectiveName, + resolutionMode, + directory, + redirectedReference, + typeRootsCacheKey, + ) : + undefined + ); + } + + function primaryLookup(): PathAndPackageId | false | undefined { // Check primary library paths if (typeRoots && typeRoots.length) { if (traceEnabled) { trace(host, Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", ")); } return firstDefined(typeRoots, typeRoot => { + // Default effective type roots, check in cache + if (!options.typeRoots) { + // TODO:: sheetal - the issue here is that when we find the result in folder thats inside the containing folder + // our type cache algo does not handle that as it assumes we have looked from containing folder and ancestor + // Need to handle that!!! + const typeRootDirectory = getDirectoryPath(getDirectoryPath(typeRoot)); + result = lookupFromCache(typeRootDirectory); + if (result) { + if (traceEnabled) { + trace(host, Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1, typeReferenceDirectiveName, typeRootDirectory); + } + if (!cache?.isReadonly) { + updateResultFromCache(result, failedLookupLocations, affectingLocations, diagnostics); + } + else { + result = { + resolvedTypeReferenceDirective: result.resolvedTypeReferenceDirective, + failedLookupLocations: initializeResolutionFieldForReadonlyCache(result.failedLookupLocations, failedLookupLocations), + affectingLocations: initializeResolutionFieldForReadonlyCache(result.affectingLocations, affectingLocations), + resolutionDiagnostics: initializeResolutionFieldForReadonlyCache(result.resolutionDiagnostics, diagnostics), + }; + } + // Failed lookup and cache update + return false; + } + } + const candidate = getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState); const directoryExists = directoryProbablyExists(typeRoot, host); if (!directoryExists && traceEnabled) { @@ -855,7 +928,7 @@ export function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: M // Walk the primary type lookup locations const result: string[] = []; if (host.directoryExists && host.getDirectories) { - const typeRoots = getEffectiveTypeRoots(options, host); + const typeRoots = getEffectiveTypeRootsWithModuleResolutionHost(options, /*redirect*/ undefined, host); if (typeRoots) { for (const root of typeRoots) { if (host.directoryExists(root)) { @@ -914,7 +987,11 @@ export interface ModeAwareCache { */ export interface PerDirectoryResolutionCache { getFromDirectoryCache(name: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined): T | undefined; + /** @internal */ + getFromDirectoryCache(name: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined, typeRootsKey?: TypeRootsCacheKeyOrSpecifiedTypeRoots): T | undefined; // eslint-disable-line @typescript-eslint/unified-signatures getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): ModeAwareCache; + /** @internal */ + getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference, typeRootsKey?: TypeRootsCacheKeyOrSpecifiedTypeRoots): ModeAwareCache; // eslint-disable-line @typescript-eslint/unified-signatures clear(): void; /** * Updates with the current compilerOptions the cache will operate with. @@ -927,7 +1004,11 @@ export interface PerDirectoryResolutionCache { export interface NonRelativeNameResolutionCache { getFromNonRelativeNameCache(nonRelativeName: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined): T | undefined; + /** @internal */ + getFromNonRelativeNameCache(nonRelativeName: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined, typeRootsKey?: TypeRootsCacheKeyOrSpecifiedTypeRoots): T | undefined; // eslint-disable-line @typescript-eslint/unified-signatures getOrCreateCacheForNonRelativeName(nonRelativeName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): PerNonRelativeNameCache; + /** @internal */ + getOrCreateCacheForNonRelativeName(nonRelativeName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference, typeRootsKey?: TypeRootsCacheKeyOrSpecifiedTypeRoots): PerNonRelativeNameCache; // eslint-disable-line @typescript-eslint/unified-signatures clear(): void; /** * Updates with the current compilerOptions the cache will operate with. @@ -1016,15 +1097,19 @@ export function getKeyForCompilerOptions(options: CompilerOptions, affectingOpti /** @internal */ export interface CacheWithRedirects { - getMapOfCacheRedirects(redirectedReference: ResolvedProjectReference | undefined): Map | undefined; - getOrCreateMapOfCacheRedirects(redirectedReference: ResolvedProjectReference | undefined): Map; + getMapOfCacheRedirects(redirectedReference: ResolvedProjectReference | undefined, typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined): Map | undefined; + getOrCreateMapOfCacheRedirects(redirectedReference: ResolvedProjectReference | undefined, typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined): Map; update(newOptions: CompilerOptions): void; clear(): void; - forEach(cb: (value: V, key: K, redirectsCacheKey: RedirectsCacheKey | undefined, map: Map) => void): void; - compact(availableOptions: Set): void; + forEach(cb: (value: V, key: K, redirectsCacheKey: RedirectsCacheKey | undefined, typeRootsKey: TypeRootsCacheKey | undefined, map: Map) => void): void; + compact( + availableOptions: Set, + availableTypeCacheKeys: Map> | undefined, + ): void; getOwnMap(): Map; getOwnOptions(): CompilerOptions | undefined; redirectsKeyToMap: Map>; + getTypesRootKeyToMap(): Map, Map>> | undefined; } /** @internal */ @@ -1035,9 +1120,34 @@ export function computeRedirectsCacheKey(options: CompilerOptions) { return getKeyForCompilerOptions(options, moduleResolutionOptionDeclarations) as RedirectsCacheKey; } +/** @internal */ +export type TypeRootsCacheKey = string & { __typeRootsKey: any; }; +/** @internal */ +export type TypeRootsCacheKeyOrSpecifiedTypeRoots = TypeRootsCacheKey | false; + +/** @internal */ +export function createTypeRootsCacheKey( + options: CompilerOptions, + redirectedReference: ResolvedProjectReference | undefined, + host: ModuleResolutionHost, +): TypeRootsCacheKeyOrSpecifiedTypeRoots { + return options.typeRoots ? + false : + `[${ + getEffectiveTypeRootsWithModuleResolutionHost( + options, + redirectedReference, + host, + )?.filter( + typeRoot => directoryProbablyExists(typeRoot, host), + )?.join(",") + }]` as TypeRootsCacheKey; +} + function createCacheWithRedirects(ownOptions: CompilerOptions | undefined, optionsToRedirectsKey: Map): CacheWithRedirects { const redirectsMap = new Map>(); const redirectsKeyToMap = new Map>(); + let typesRootKeyToMap: Map, Map>> | undefined; let ownMap = new Map(); if (ownOptions) redirectsMap.set(ownOptions, ownMap); return { @@ -1050,18 +1160,37 @@ function createCacheWithRedirects(ownOptions: CompilerOptions | undefined, getOwnMap: () => ownMap, getOwnOptions: () => ownOptions, redirectsKeyToMap, + getTypesRootKeyToMap: () => typesRootKeyToMap, }; - function getMapOfCacheRedirects(redirectedReference: ResolvedProjectReference | undefined): Map | undefined { - return redirectedReference ? - getOrCreateMap(redirectedReference.commandLine.options, /*create*/ false) : + function getOrCreateMapWithTypeRoots(redirectedReference: ResolvedProjectReference | undefined, typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, create: true): Map; + function getOrCreateMapWithTypeRoots(redirectedReference: ResolvedProjectReference | undefined, typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, create: false): Map | undefined; + function getOrCreateMapWithTypeRoots(redirectedReference: ResolvedProjectReference | undefined, typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, create: boolean): Map | undefined { + const map = redirectedReference ? + getOrCreateMap(redirectedReference.commandLine.options, /*create*/ true) : ownMap; + if (!map || !typeRootsKey) return map; + let typeRootsKeyMap = typesRootKeyToMap?.get(map); + let result = typeRootsKeyMap?.get(typeRootsKey); + if (!result && create) { + if (!typeRootsKeyMap) (typesRootKeyToMap ??= new Map()).set(map, typeRootsKeyMap = new Map()); + typeRootsKeyMap.set(typeRootsKey, result = new Map()); + } + return result; } - function getOrCreateMapOfCacheRedirects(redirectedReference: ResolvedProjectReference | undefined): Map { - return redirectedReference ? - getOrCreateMap(redirectedReference.commandLine.options, /*create*/ true) : - ownMap; + function getMapOfCacheRedirects( + redirectedReference: ResolvedProjectReference | undefined, + typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, + ): Map | undefined { + return getOrCreateMapWithTypeRoots(redirectedReference, typeRootsKey, /*create*/ false); + } + + function getOrCreateMapOfCacheRedirects( + redirectedReference: ResolvedProjectReference | undefined, + typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, + ): Map { + return getOrCreateMapWithTypeRoots(redirectedReference, typeRootsKey, /*create*/ true); } function update(newOptions: CompilerOptions) { @@ -1098,6 +1227,7 @@ function createCacheWithRedirects(ownOptions: CompilerOptions | undefined, redirectsMap.clear(); optionsToRedirectsKey.clear(); redirectsKeyToMap.clear(); + typesRootKeyToMap = undefined; if (ownOptions) { if (ownKey) optionsToRedirectsKey.set(ownOptions, ownKey); redirectsMap.set(ownOptions, ownMap); @@ -1112,24 +1242,71 @@ function createCacheWithRedirects(ownOptions: CompilerOptions | undefined, return result; } - function forEach(cb: (value: V, key: K, redirectsCacheKey: RedirectsCacheKey | undefined, map: Map) => void) { - ownMap.forEach((value, key) => cb(value, key, /*redirectsCacheKey*/ undefined, ownMap)); + function forEach( + cb: ( + value: V, + key: K, + redirectsCacheKey: RedirectsCacheKey | undefined, + typeRootsKey: TypeRootsCacheKey | undefined, + map: Map, + ) => void, + ) { + forEachMapWithTypeRootKey(ownMap, /*redirectsCacheKey*/ undefined, cb); redirectsKeyToMap.forEach((map, redirectsCacheKey) => { - if (map !== ownMap) map.forEach((value, key) => cb(value, key, redirectsCacheKey, map)); + if (map !== ownMap) forEachMapWithTypeRootKey(map, redirectsCacheKey, cb); }); } - function compact(availableOptions: Set) { + function forEachMapWithTypeRootKey( + map: Map, + redirectsCacheKey: RedirectsCacheKey | undefined, + cb: (value: V, key: K, redirectsCacheKey: RedirectsCacheKey | undefined, typeRootsKey: TypeRootsCacheKey | undefined, map: Map) => void, + ) { + map.forEach((value, key) => cb(value, key, redirectsCacheKey, /*typeRootsKey*/ undefined, map)); + typesRootKeyToMap?.get(map)?.forEach( + (map, typesRootKey) => map.forEach((value, key) => cb(value, key, redirectsCacheKey, typesRootKey, map)), + ); + } + + function compact( + availableOptions: Set, + availableTypeCacheKeys: Map> | undefined, + ) { const toDeleteRedirectsCacheKeys = new Set(redirectsKeyToMap.keys()); + if (!availableTypeCacheKeys?.size) typesRootKeyToMap = undefined; + const toDeleteTypesRootKeyToMap = typesRootKeyToMap && new Map, Set>(); + typesRootKeyToMap?.forEach((keyToMap, map) => toDeleteTypesRootKeyToMap!.set(map, new Set(keyToMap.keys()))); + optionsToRedirectsKey.forEach((key, options) => { if (options === ownOptions || availableOptions.has(options)) { toDeleteRedirectsCacheKeys.delete(key); + keepTypesRootKeyMap(availableTypeCacheKeys, options, toDeleteTypesRootKeyToMap, options === ownOptions ? ownMap : redirectsKeyToMap.get(key)!); } else { redirectsMap.delete(options); } }); + if (ownOptions) keepTypesRootKeyMap(availableTypeCacheKeys, ownOptions, toDeleteTypesRootKeyToMap, ownMap); toDeleteRedirectsCacheKeys.forEach(key => redirectsKeyToMap.delete(key)); + toDeleteTypesRootKeyToMap?.forEach((typeRootKeys, map) => { + const keyToMap = typesRootKeyToMap!.get(map)!; + if (keyToMap.size === typeRootKeys.size) typesRootKeyToMap!.delete(map); + else typeRootKeys.forEach(key => keyToMap.delete(key)); + }); + } + + function keepTypesRootKeyMap( + availableTypeCacheKeys: Map> | undefined, + options: CompilerOptions, + toDeleteTypesRootKeyToMap: Map, Set> | undefined, + map: Map, + ) { + const setOfKeys = toDeleteTypesRootKeyToMap?.get(map); + if (!setOfKeys?.size) return; + availableTypeCacheKeys?.get(options)?.forEach( + typeRootsKey => typeRootsKey ? setOfKeys.delete(typeRootsKey) : undefined, + ); + if (!setOfKeys.size) toDeleteTypesRootKeyToMap!.delete(map); } } @@ -1150,8 +1327,14 @@ function createPackageJsonInfoCache(currentDirectory: string, getCanonicalFileNa } } -function getOrCreateCache(cacheWithRedirects: CacheWithRedirects, redirectedReference: ResolvedProjectReference | undefined, key: K, create: () => V): V { - const cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference); +function getOrCreateCache( + cacheWithRedirects: CacheWithRedirects, + redirectedReference: ResolvedProjectReference | undefined, + typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, + key: K, + create: () => V, +): V { + const cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference, typeRootsKey); let result = cache.get(key); if (!result) { result = create(); @@ -1184,14 +1367,14 @@ function createPerDirectoryResolutionCache( directoryToModuleNameMap.update(options); } - function getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference) { + function getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference, typeRootsKey?: TypeRootsCacheKeyOrSpecifiedTypeRoots) { const path = toPath(directoryName, currentDirectory, getCanonicalFileName); - return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, () => createModeAwareCache()); + return getOrCreateCache(directoryToModuleNameMap, redirectedReference, typeRootsKey, path, () => createModeAwareCache()); } - function getFromDirectoryCache(name: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined) { + function getFromDirectoryCache(name: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined, typeRootsKey?: TypeRootsCacheKeyOrSpecifiedTypeRoots) { const path = toPath(directoryName, currentDirectory, getCanonicalFileName); - return getValidResolution(directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)?.get(path)?.get(name, mode)); + return getValidResolution(directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference, typeRootsKey)?.get(path)?.get(name, mode)); } } @@ -1277,18 +1460,19 @@ function createNonRelativeNameResolutionCache( moduleNameToDirectoryMap.update(options); } - function getFromNonRelativeNameCache(nonRelativeModuleName: string, mode: ResolutionMode, directoryName: string, redirectedReference?: ResolvedProjectReference): T | undefined { + function getFromNonRelativeNameCache(nonRelativeModuleName: string, mode: ResolutionMode, directoryName: string, redirectedReference?: ResolvedProjectReference, typeRootsKey?: TypeRootsCacheKeyOrSpecifiedTypeRoots): T | undefined { Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName)); - return moduleNameToDirectoryMap.getMapOfCacheRedirects(redirectedReference)?.get( + return moduleNameToDirectoryMap.getMapOfCacheRedirects(redirectedReference, typeRootsKey)?.get( createModeAwareCacheKey(nonRelativeModuleName, mode), )?.get(directoryName); } - function getOrCreateCacheForNonRelativeName(nonRelativeModuleName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference): PerNonRelativeNameCache { + function getOrCreateCacheForNonRelativeName(nonRelativeModuleName: string, mode: ResolutionMode, redirectedReference?: ResolvedProjectReference, typeRootsKey?: TypeRootsCacheKeyOrSpecifiedTypeRoots): PerNonRelativeNameCache { Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName)); return getOrCreateCache( moduleNameToDirectoryMap, redirectedReference, + typeRootsKey, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache, ); @@ -1406,12 +1590,17 @@ function createNonRelativeNameResolutionCache( export interface ModuleOrTypeReferenceResolutionCache extends PerDirectoryResolutionCache, NonRelativeNameResolutionCache, PackageJsonInfoCache { getPackageJsonInfoCache(): PackageJsonInfoCache; gc(setOrMapToCheckPresence: Set | Map): void; - compact(availableOptions?: Set, skipOptionsToRedirectsKeyCleanup?: boolean): void; + compact( + availableOptions?: Set, + skipOptionsToRedirectsKeyCleanup?: boolean, + availableTypeCacheKeys?: Map>, + ): void; setPerDirectoryAndNonRelativeNameCacheResult( name: string, mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined, + typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, result: T, primary?: T, ): void; @@ -1477,14 +1666,17 @@ function createModuleOrTypeReferenceResolutionCache( function gc(setOrMapToCheckPresence: Set | Map) { // Iterate through maps to remove things that have 0 refCount - perDirectoryResolutionCache.directoryToModuleNameMap.forEach((resolutions, dir, redirectsCacheKey, directoryToModuleNameMap) => { + perDirectoryResolutionCache.directoryToModuleNameMap.forEach((resolutions, dir, redirectsCacheKey, typeRootsKey, directoryToModuleNameMap) => { resolutions.forEach((resolution, name, mode, key) => { if (setOrMapToCheckPresence.has(resolution)) return; resolutions.delete(name, mode); if (!isExternalModuleNameRelative(name)) { - const moduleNameToDirectoryMap = !redirectsCacheKey ? + const ownOrRedirectsMap = !redirectsCacheKey ? nonRelativeNameResolutionCache.moduleNameToDirectoryMap.getOwnMap() : nonRelativeNameResolutionCache.moduleNameToDirectoryMap.redirectsKeyToMap.get(redirectsCacheKey); + const moduleNameToDirectoryMap = ownOrRedirectsMap && typeRootsKey ? + nonRelativeNameResolutionCache.moduleNameToDirectoryMap.getTypesRootKeyToMap()?.get(ownOrRedirectsMap)?.get(typeRootsKey) : + ownOrRedirectsMap; const directoryMap = moduleNameToDirectoryMap?.get(key); directoryMap?.deleteByPath(dir); if (!directoryMap?.directoryPathMap.size) moduleNameToDirectoryMap!.delete(key); @@ -1494,9 +1686,13 @@ function createModuleOrTypeReferenceResolutionCache( }); } - function compact(availableOptions = new Set(optionsToRedirectsKey!.keys()), skipOptionsToRedirectsKeyCleanup?: boolean) { - perDirectoryResolutionCache.directoryToModuleNameMap.compact(availableOptions); - nonRelativeNameResolutionCache.moduleNameToDirectoryMap.compact(availableOptions); + function compact( + availableOptions = new Set(optionsToRedirectsKey!.keys()), + skipOptionsToRedirectsKeyCleanup?: boolean, + availableTypeCacheKeys?: Map>, + ) { + perDirectoryResolutionCache.directoryToModuleNameMap.compact(availableOptions, availableTypeCacheKeys); + nonRelativeNameResolutionCache.moduleNameToDirectoryMap.compact(availableOptions, availableTypeCacheKeys); if (!skipOptionsToRedirectsKeyCleanup) { optionsToRedirectsKey!.forEach( (_redirectsKey, options) => { @@ -1511,31 +1707,32 @@ function createModuleOrTypeReferenceResolutionCache( mode: ResolutionMode, directoryName: string, redirectedReference: ResolvedProjectReference | undefined, + typeRootsKey: TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, result: T, primary?: T, ): void { if (cache.isReadonly) return; - cache.getOrCreateCacheForDirectory(directoryName, redirectedReference).set(name, mode, result); - if (!isExternalModuleNameRelative(name)) { + cache.getOrCreateCacheForDirectory(directoryName, redirectedReference, typeRootsKey).set(name, mode, result); + if (typeRootsKey !== false && !isExternalModuleNameRelative(name)) { // put result in per-module name cache - cache.getOrCreateCacheForNonRelativeName(name, mode, redirectedReference).set(directoryName, result, primary); + cache.getOrCreateCacheForNonRelativeName(name, mode, redirectedReference, typeRootsKey).set(directoryName, result, primary); } } function print() { console.log(`directoryToModuleNameMap::`); - perDirectoryResolutionCache.directoryToModuleNameMap.forEach((moduleNameMap, directoryPath, redirectsCacheKey) => { - if (!redirectsCacheKey) console.log(" OwnMap"); - else console.log(` redirectsCacheKey:: ${redirectsCacheKey}`); + perDirectoryResolutionCache.directoryToModuleNameMap.forEach((moduleNameMap, directoryPath, redirectsCacheKey, typeRootsKey) => { + if (!redirectsCacheKey) console.log(` OwnMap ${typeRootsKey ? typeRootsKey : ""}`); + else console.log(` redirectsCacheKey:: ${redirectsCacheKey} ${typeRootsKey ? typeRootsKey : ""}`); console.log(` directoryPath:: ${directoryPath}`); moduleNameMap.forEach((value, key, mode) => { console.log(` ${key} ${mode} ${JSON.stringify(value, undefined, " ")}`); }); }); console.log(`moduleNameToDirectoryMap::`); - nonRelativeNameResolutionCache.moduleNameToDirectoryMap.forEach((perNonRelativeNameCache, key, redirectsCacheKey) => { - if (!redirectsCacheKey) console.log(" OwnMap"); - else console.log(` redirectsCacheKey:: ${redirectsCacheKey}`); + nonRelativeNameResolutionCache.moduleNameToDirectoryMap.forEach((perNonRelativeNameCache, key, redirectsCacheKey, typeRootsKey) => { + if (!redirectsCacheKey) console.log(` OwnMap ${typeRootsKey ? typeRootsKey : ""}`); + else console.log(` redirectsCacheKey:: ${redirectsCacheKey} ${typeRootsKey ? typeRootsKey : ""}`); console.log(` modeAwareCacheKey:: ${key}`); perNonRelativeNameCache.directoryPathMap.forEach((value, key) => { console.log(` ${key} ${JSON.stringify(value, undefined, " ")}`); @@ -1695,6 +1892,7 @@ export function resolveModuleName(moduleName: string, containingFile: string, co resolutionMode, containingDirectory, redirectedReference, + undefined, result, ); } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 0cb81602298b0..f3a1525254cce 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -50,6 +50,7 @@ import { createSymlinkCache, createTypeChecker, createTypeReferenceDirectiveResolutionCache, + createTypeRootsCacheKey, CustomTransformers, Debug, DeclarationWithTypeParameterChildren, @@ -117,6 +118,7 @@ import { getDeclarationDiagnostics as ts_getDeclarationDiagnostics, getDefaultLibFileName, getDirectoryPath, + getEffectiveTypeRoots as ts_getEffectiveTypeRoots, getEmitDeclarations, getEmitModuleKind, getEmitModuleResolutionKind, @@ -320,6 +322,7 @@ import { TypeChecker, typeDirectiveIsEqualTo, TypeReferenceDirectiveResolutionCache, + TypeRootsCacheKeyOrSpecifiedTypeRoots, unprefixedNodeCoreModules, VariableDeclaration, VariableStatement, @@ -1812,6 +1815,9 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg let projectReferenceRedirects: Map | undefined; let mapFromFileToProjectReferenceRedirects: Map | undefined; let mapFromToProjectReferenceRedirectSource: Map | undefined; + let typeRootsCacheKeys: Map | undefined; + let processingTypeRootsCacheKeys: Map | undefined; + let effectiveRoots: Map | undefined; const useSourceOfProjectReferenceRedirect = !!host.useSourceOfProjectReferenceRedirect?.() && !options.disableSourceOfProjectReferenceRedirect; @@ -1825,6 +1831,9 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg forEachResolvedProjectReference, }); const readFile = host.readFile.bind(host) as typeof host.readFile; + const hostGetEffectiveTypeRoots = host.getEffectiveTypeRoots; + const hostGetTypeRootsCacheKey = host.getTypeRootsCacheKey; + host.getEffectiveTypeRoots = getEffectiveTypeRoots; tracing?.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); @@ -1883,6 +1892,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg const resolutions = resolveTypeReferenceDirectiveNamesReusingOldState( automaticTypeDirectiveNames, getAutomaticTypeDirectiveContainingFile(options, currentDirectory), + getTypeRootsCacheKey, ); for (let i = 0; i < automaticTypeDirectiveNames.length; i++) { // under node16/nodenext module resolution, load `types`/ata include names as cjs resolution results by passing an `undefined` mode @@ -1971,6 +1981,10 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg resolvedLibProcessing = undefined; resolvedModulesProcessing = undefined; resolvedTypeReferenceDirectiveNamesProcessing = undefined; + effectiveRoots = undefined; + processingTypeRootsCacheKeys = undefined; + host.getEffectiveTypeRoots = hostGetEffectiveTypeRoots; + host.getTypeRootsCacheKey = hostGetTypeRootsCacheKey; const program: Program = { getRootFileNames: () => rootNames, @@ -2054,6 +2068,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg structureIsReused, writeFile, getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation), + getTypeRootsCacheKeys: () => typeRootsCacheKeys, }; onProgramCreateComplete(); @@ -2251,6 +2266,51 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg return result; } + function getEffectiveTypeRoots(options: CompilerOptions, redirect: ResolvedProjectReference | undefined) { + let result = effectiveRoots?.get(redirect?.sourceFile.path); + if (result === undefined) { + (effectiveRoots ??= new Map()).set( + redirect?.sourceFile.path, + result = ( + hostGetEffectiveTypeRoots ? + hostGetEffectiveTypeRoots(options, redirect) : + ts_getEffectiveTypeRoots(options, host) + ) ?? false, + ); + } + return result || undefined; + } + + function getTypeRootsCacheKey(options: CompilerOptions, redirect: ResolvedProjectReference | undefined): TypeRootsCacheKeyOrSpecifiedTypeRoots { + let result = typeRootsCacheKeys?.get(redirect?.sourceFile.path); + if (result === undefined) { + (typeRootsCacheKeys ??= new Map()).set( + redirect?.sourceFile.path, + result = processingTypeRootsCacheKeys?.get(redirect?.sourceFile.path) ?? + getTypeRootsCacheKeyWorker(options, redirect) ?? + false, + ); + } + return result; + } + + function getProcessingTypeRootsCacheKey(options: CompilerOptions, redirect: ResolvedProjectReference | undefined): TypeRootsCacheKeyOrSpecifiedTypeRoots { + let result = processingTypeRootsCacheKeys?.get(redirect?.sourceFile.path); + if (result === undefined) { + (processingTypeRootsCacheKeys ??= new Map()).set( + redirect?.sourceFile.path, + result = getTypeRootsCacheKeyWorker(options, redirect) ?? false, + ); + } + return result; + } + + function getTypeRootsCacheKeyWorker(options: CompilerOptions, redirect: ResolvedProjectReference | undefined): TypeRootsCacheKeyOrSpecifiedTypeRoots { + return hostGetTypeRootsCacheKey ? + hostGetTypeRootsCacheKey(options, redirect) : + createTypeRootsCacheKey(options, redirect, host); + } + function getRedirectReferenceForResolution(file: SourceFile) { const redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); if (redirect || !isDeclarationFileName(file.originalFileName)) return redirect; @@ -2346,9 +2406,21 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg }); } - function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames: readonly FileReference[], containingFile: SourceFile): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]; - function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames: readonly string[], containingFile: string): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]; - function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames: readonly T[], containingFile: string | SourceFile): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] { + function resolveTypeReferenceDirectiveNamesReusingOldState( + typeDirectiveNames: readonly FileReference[], + containingFile: SourceFile, + getTypeRootsCacheKey: (options: CompilerOptions, redirects: ResolvedProjectReference | undefined) => TypeRootsCacheKeyOrSpecifiedTypeRoots, + ): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]; + function resolveTypeReferenceDirectiveNamesReusingOldState( + typeDirectiveNames: readonly string[], + containingFile: string, + getTypeRootsCacheKey: (options: CompilerOptions, redirects: ResolvedProjectReference | undefined) => TypeRootsCacheKeyOrSpecifiedTypeRoots, + ): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]; + function resolveTypeReferenceDirectiveNamesReusingOldState( + typeDirectiveNames: readonly T[], + containingFile: string | SourceFile, + getTypeRootsCacheKey: (options: CompilerOptions, redirects: ResolvedProjectReference | undefined) => TypeRootsCacheKeyOrSpecifiedTypeRoots, + ): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] { const containingSourceFile = !isString(containingFile) ? containingFile : undefined; return resolveNamesReusingOldState({ entries: typeDirectiveNames, @@ -2367,6 +2439,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg containingSourceFile ? containingSourceFile === oldProgram?.getSourceFile(containingSourceFile.fileName) && !hasInvalidatedResolutions(containingSourceFile.path) : !hasInvalidatedResolutions(toPath(containingFile as string)), + getTypeRootsCacheKey, }); } @@ -2393,6 +2466,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg getResolved: (oldResolution: Resolution) => ResolutionWithResolvedFileName | undefined; canReuseResolutionsInFile: () => boolean; resolveToOwnAmbientModule?: true; + getTypeRootsCacheKey?: (options: CompilerOptions, redirects: ResolvedProjectReference | undefined) => TypeRootsCacheKeyOrSpecifiedTypeRoots; } function resolveNamesReusingOldState({ @@ -2407,6 +2481,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg getResolved, canReuseResolutionsInFile, resolveToOwnAmbientModule, + getTypeRootsCacheKey, }: ResolveNamesReusingOldStateInput): readonly Resolution[] { if (!entries.length) { onReusedResolutions?.( @@ -2417,7 +2492,10 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg ); return emptyArray; } + // Ensure typeRootsCacheKey is cached + getTypeRootsCacheKey?.(redirectedReference?.commandLine.options ?? options, redirectedReference); if (structureIsReused === StructureIsReused.Not && (!resolveToOwnAmbientModule || !containingSourceFile!.ambientModuleNames.length)) { + host.getTypeRootsCacheKey = getTypeRootsCacheKey; // If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules, // the best we can do is fallback to the default logic. return resolutionWorker( @@ -2494,6 +2572,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg ); return result!; } + host.getTypeRootsCacheKey = getTypeRootsCacheKey; const resolutions = resolutionWorker( unknownEntries, containingFile, @@ -2703,7 +2782,11 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg ); if (resolutionsChanged) structureIsReused = StructureIsReused.SafeModules; const typesReferenceDirectives = newSourceFile.typeReferenceDirectives; - const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile); + const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState( + typesReferenceDirectives, + newSourceFile, + getProcessingTypeRootsCacheKey, + ); (resolvedTypeReferenceDirectiveNamesProcessing ??= new Map()).set(newSourceFile.path, typeReferenceResolutions); // ensure that types resolutions are still correct const typeReferenceResolutionsChanged = hasChangesInResolutions( @@ -2778,6 +2861,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg resolvedTypeReferenceDirectiveNames = oldProgram.resolvedTypeReferenceDirectiveNames; resolvedLibReferences = oldProgram.resolvedLibReferences; packageMap = oldProgram.getCurrentPackagesMap(); + typeRootsCacheKeys = oldProgram.getTypeRootsCacheKeys(); return StructureIsReused.Completely; } @@ -4057,7 +4141,13 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } const resolutions = resolvedTypeReferenceDirectiveNamesProcessing?.get(file.path) || - resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file); + resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file, getTypeRootsCacheKey); + if (resolutions.length && resolvedTypeReferenceDirectiveNamesProcessing?.get(file.path)) { + // Ensure type reference key is cached from processing to actual + const redirect = getRedirectReferenceForResolution(file); + const value = processingTypeRootsCacheKeys?.get(redirect?.sourceFile.path); + if (value !== undefined) (typeRootsCacheKeys ??= new Map()).set(redirect?.sourceFile.path, value); + } const resolutionsInFile = createModeAwareCache(); (resolvedTypeReferenceDirectiveNames ??= new Map()).set(file.path, resolutionsInFile); for (let index = 0; index < typeDirectives.length; index++) { diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index 85903d95fc170..a0e27409e183d 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -74,6 +74,7 @@ import { trace, TypeReferenceDirectiveResolutionCache, typeReferenceResolutionNameAndModeGetter, + TypeRootsCacheKeyOrSpecifiedTypeRoots, WatchDirectoryFlags, } from "./_namespaces/ts.js"; @@ -360,6 +361,7 @@ function resolveModuleNameUsingGlobalCache( mode, getDirectoryPath(containingFile), redirectedReference, + undefined, primary.globalCacheResolution.globalResult, primary, ); @@ -658,16 +660,25 @@ export function createResolutionCache( function compactCaches(newProgram: Program | undefined) { const availableOptions = new Set(); + const availableTypeCacheKeys = new Map>(); if (newProgram) { availableOptions.add(newProgram.getCompilerOptions()); + const key = newProgram.getTypeRootsCacheKeys()?.get(/*key*/ undefined); + if (key !== undefined) availableTypeCacheKeys.set(newProgram.getCompilerOptions(), new Set([key])); newProgram.forEachResolvedProjectReference(ref => { availableOptions.add(ref.commandLine.options); + const key = newProgram.getTypeRootsCacheKeys()?.get(ref.sourceFile.path); + if (key !== undefined) { + const existing = availableTypeCacheKeys.get(ref.commandLine.options); + if (existing) existing.add(key); + else availableTypeCacheKeys.set(ref.commandLine.options, new Set([key])); + } }); } moduleResolutionCache.compact(availableOptions, /*skipOptionsToRedirectsKeyCleanup*/ true); - typeReferenceDirectiveResolutionCache.compact(availableOptions); + typeReferenceDirectiveResolutionCache.compact(availableOptions, /*skipOptionsToRedirectsKeyCleanup*/ false, availableTypeCacheKeys); libraryResolutionCache.compact(); - sharedCache.compactCaches(availableOptions, cache); + sharedCache.compactCaches(availableOptions, availableTypeCacheKeys, cache); } function gcModuleOrTypeRefCache( diff --git a/src/compiler/sharedResolutionCache.ts b/src/compiler/sharedResolutionCache.ts index 2f9fb4428b220..e1cfd1057997c 100644 --- a/src/compiler/sharedResolutionCache.ts +++ b/src/compiler/sharedResolutionCache.ts @@ -45,6 +45,7 @@ import { startsWith, tryAddToSet, TypeReferenceDirectiveResolutionCache, + TypeRootsCacheKeyOrSpecifiedTypeRoots, WatchDirectoryFlags, } from "./_namespaces/ts.js"; @@ -55,6 +56,12 @@ declare module "./_namespaces/ts.js" { } } +/** @internal */ +export interface CacheToOptionsEntry { + availableOptions: Set; + availableTypeCacheKeys: Map>; +} + /** * This is the cache of module/typedirectives resolution that are shared across projects * @@ -72,7 +79,7 @@ export interface SharedResolutionCache { watchedResolutionInfoMap: Map; typeRootsWatches: Map; inUseResolutionCaches: RefCountCache; - cacheToOptions: Map>; + cacheToOptions: Map; directoryWatchesOfFailedLookups: Map; nonRecursiveDirectoryWatchesOfFailedLookups: Map; fileWatchesOfAffectingLocations: Map; @@ -82,7 +89,11 @@ export interface SharedResolutionCache { clear(cache: ResolutionCache): void; startCachingPerDirectoryResolution(cache: ResolutionCache): void; finishCachingPerDirectoryResolution(): void; - compactCaches(availableOptions: Set, cache: ResolutionCache): void; + compactCaches( + availableOptions: Set, + availableTypeCacheKeys: Map>, + cache: ResolutionCache, + ): void; watchResolution( resolution: T, @@ -412,7 +423,7 @@ export function createSharedResolutionCache(sharedCacheHost: SharedResolutionCac const watchedResolutionInfoMap = new Map(); const typeRootsWatches = new Map(); const inUseResolutionCaches = new Map(); - const cacheToOptions = new Map>(); + const cacheToOptions = new Map(); let affectingPathChecks: Set | undefined; let failedLookupChecks: Set | undefined; @@ -587,21 +598,36 @@ export function createSharedResolutionCache(sharedCacheHost: SharedResolutionCac currentCache = undefined; } - function compactCaches(availableOptions: Set, cache: ResolutionCache) { - if (availableOptions.size) cacheToOptions.set(cache, availableOptions); + function compactCaches( + availableOptions: Set, + availableTypeCacheKeys: Map>, + cache: ResolutionCache, + ) { + if (availableOptions.size) cacheToOptions.set(cache, { availableOptions, availableTypeCacheKeys }); else cacheToOptions.delete(cache); compactCachesWoker(); } function compactCachesWoker() { let availableOptions: Set; - if (cacheToOptions.size === 1) availableOptions = firstDefinedIterator(cacheToOptions.values(), identity)!; + let availableTypeCacheKeys: Map>; + if (cacheToOptions.size === 1) { + ({ availableOptions, availableTypeCacheKeys } = firstDefinedIterator(cacheToOptions.values(), identity)!); + } else { availableOptions = new Set(); - cacheToOptions.forEach(setOfOptions => setOfOptions.forEach(options => availableOptions.add(options))); + availableTypeCacheKeys = new Map(); + cacheToOptions.forEach(entry => { + entry.availableOptions.forEach(options => availableOptions.add(options)); + entry.availableTypeCacheKeys.forEach((keys, options) => { + const existing = availableTypeCacheKeys.get(options); + if (existing) keys.forEach(key => existing.add(key)); + else availableTypeCacheKeys.set(options, new Set(keys)); + }); + }); } moduleResolutionCache.compact(availableOptions, /*skipOptionsToRedirectsKeyCleanup*/ true); - typeReferenceDirectiveResolutionCache.compact(availableOptions); + typeReferenceDirectiveResolutionCache.compact(availableOptions, /*skipOptionsToRedirectsKeyCleanup*/ false, availableTypeCacheKeys); libraryResolutionCache.compact(); } @@ -1351,12 +1377,12 @@ export function enableSharingModuleOrTypeReferenceResolutionCache { - let result = getFromDirectoryCache.call(moduleOrTypeRefCache, name, mode, directoryName, redirectedReference); + moduleOrTypeRefCache.getFromDirectoryCache = (name, mode, directoryName, redirectedReference, typeRootsKey?) => { + let result = getFromDirectoryCache.call(moduleOrTypeRefCache, name, mode, directoryName, redirectedReference, typeRootsKey); if (result) return result; result = withSharingModuleOrTypeReferenceResolutionCache( moduleOrTypeRefCache, - sharedCache => sharedCache.getFromDirectoryCache(name, mode, directoryName, redirectedReference), + sharedCache => sharedCache.getFromDirectoryCache(name, mode, directoryName, redirectedReference, typeRootsKey as TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined), ); if (result) { moduleOrTypeRefCache.setPerDirectoryAndNonRelativeNameCacheResult( @@ -1364,26 +1390,27 @@ export function enableSharingModuleOrTypeReferenceResolutionCache - getFromNonRelativeNameCache.call(moduleOrTypeRefCache, nonRelativeModuleName, mode, directoryName, redirectedReference) || + moduleOrTypeRefCache.getFromNonRelativeNameCache = (nonRelativeModuleName, mode, directoryName, redirectedReference, typeRootsKey?) => + getFromNonRelativeNameCache.call(moduleOrTypeRefCache, nonRelativeModuleName, mode, directoryName, redirectedReference, typeRootsKey) || withSharingModuleOrTypeReferenceResolutionCache( moduleOrTypeRefCache, - sharedCache => sharedCache?.getFromNonRelativeNameCache(nonRelativeModuleName, mode, directoryName, redirectedReference), + sharedCache => sharedCache?.getFromNonRelativeNameCache(nonRelativeModuleName, mode, directoryName, redirectedReference, typeRootsKey as TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined), ); const setPerDirectoryAndNonRelativeNameCacheResult = moduleOrTypeRefCache.setPerDirectoryAndNonRelativeNameCacheResult; - moduleOrTypeRefCache.setPerDirectoryAndNonRelativeNameCacheResult = (name, mode, directoryName, redirectedReference, result, primary) => { - setPerDirectoryAndNonRelativeNameCacheResult.call(moduleOrTypeRefCache, name, mode, directoryName, redirectedReference, result, primary); + moduleOrTypeRefCache.setPerDirectoryAndNonRelativeNameCacheResult = (name, mode, directoryName, redirectedReference, typeRootsKey, result, primary) => { + setPerDirectoryAndNonRelativeNameCacheResult.call(moduleOrTypeRefCache, name, mode, directoryName, redirectedReference, typeRootsKey, result, primary); if (primary) return; // Already in the cache result = result.globalCacheResolution?.primary || result; withSharingModuleOrTypeReferenceResolutionCache( moduleOrTypeRefCache, - sharedCache => sharedCache.setPerDirectoryAndNonRelativeNameCacheResult(name, mode, directoryName, redirectedReference, result), + sharedCache => sharedCache.setPerDirectoryAndNonRelativeNameCacheResult(name, mode, directoryName, redirectedReference, typeRootsKey, result), ); }; const update = moduleOrTypeRefCache.update; diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 04ca4db0fde66..621ae6d4e3909 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -27,6 +27,7 @@ import { createProgramHost, createTypeReferenceDirectiveResolutionCache, createTypeReferenceResolutionLoader, + createTypeRootsCacheKey, createWatchFactory, createWatchHost, CustomTransformers, @@ -57,6 +58,7 @@ import { getBuildInfoFileVersionMap, getConfigFileParsingDiagnostics, getDirectoryPath, + getEffectiveTypeRoots as ts_getEffectiveTypeRoots, getEmitDeclarations, getErrorCountForSummary, getFileNamesFromConfigSpecs, @@ -101,6 +103,7 @@ import { ReadBuildProgramHost, resolveConfigFileProjectName, ResolvedConfigFileName, + ResolvedProjectReference, resolveLibrary, resolvePath, resolveProjectReferencePath, @@ -114,6 +117,7 @@ import { System, toPath as ts_toPath, TypeReferenceDirectiveResolutionCache, + TypeRootsCacheKeyOrSpecifiedTypeRoots, unorderedRemoveItem, updateErrorForNoInputFiles, updateSharedExtendedConfigFileWatcher, @@ -399,6 +403,8 @@ interface SolutionBuilderState extends WatchFactory; + readonly effectiveTypeRoots: Map; // Mutable state buildOrder: AnyBuildOrder | undefined; @@ -434,6 +440,8 @@ function createSolutionBuilderState(watch: boolean, ho const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options); const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions) as CompilerHost & ReadBuildProgramHost; setGetSourceFileAsHashVersioned(compilerHost); + compilerHost.getTypeRootsCacheKey = (options, redirect) => getTypeRootsCacheKey(state, options, redirect); + compilerHost.getEffectiveTypeRoots = (options, redirect) => getEffectiveTypeRoots(state, options, redirect); compilerHost.getParsedCommandLine = fileName => parseConfigFile(state, fileName as ResolvedConfigFileName, toResolvedConfigFilePath(state, fileName as ResolvedConfigFileName)); compilerHost.resolveModuleNameLiterals = maybeBind(host, host.resolveModuleNameLiterals); compilerHost.resolveTypeReferenceDirectiveReferences = maybeBind(host, host.resolveTypeReferenceDirectiveReferences); @@ -521,6 +529,8 @@ function createSolutionBuilderState(watch: boolean, ho moduleResolutionCache, typeReferenceDirectiveResolutionCache, libraryResolutionCache, + typeRootsCacheKeyMap: new Map(), + effectiveTypeRoots: new Map(), // Mutable state buildOrder: undefined, @@ -566,6 +576,38 @@ function toResolvedConfigFilePath(state: SolutionBuild return resolvedPath; } +function getEffectiveTypeRoots( + state: SolutionBuilderState, + options: CompilerOptions, + redirects: ResolvedProjectReference | undefined, +) { + const path = !redirects ? options.configFile!.path : redirects.sourceFile.path; + let result = state.effectiveTypeRoots.get(path); + if (result === undefined) { + state.effectiveTypeRoots.set( + path, + result = ts_getEffectiveTypeRoots(options, state.compilerHost) ?? false, + ); + } + return result || undefined; +} + +function getTypeRootsCacheKey( + state: SolutionBuilderState, + options: CompilerOptions, + redirects: ResolvedProjectReference | undefined, +): TypeRootsCacheKeyOrSpecifiedTypeRoots { + const path = !redirects ? options.configFile!.path : redirects.sourceFile.path; + let result = state.typeRootsCacheKeyMap.get(path); + if (result === undefined) { + state.typeRootsCacheKeyMap.set( + path, + result = createTypeRootsCacheKey(options, redirects, state.compilerHost) ?? false, + ); + } + return result; +} + function isParsedCommandLine(entry: ConfigFileCacheEntry): entry is ParsedCommandLine { return !!(entry as ParsedCommandLine).options; } @@ -777,20 +819,19 @@ function enableCache(state: SolutionBuilderState) { function disableCache(state: SolutionBuilderState) { if (!state.cache) return; - - const { cache, host, compilerHost, extendedConfigCache, moduleResolutionCache, typeReferenceDirectiveResolutionCache, libraryResolutionCache } = state; - - host.readFile = cache.originalReadFile; - host.fileExists = cache.originalFileExists; - host.directoryExists = cache.originalDirectoryExists; - host.createDirectory = cache.originalCreateDirectory; - host.writeFile = cache.originalWriteFile; - compilerHost.getSourceFile = cache.originalGetSourceFile; - state.readFileWithCache = cache.originalReadFileWithCache; - extendedConfigCache.clear(); - moduleResolutionCache?.clear(); - typeReferenceDirectiveResolutionCache?.clear(); - libraryResolutionCache?.clear(); + state.host.readFile = state.cache.originalReadFile; + state.host.fileExists = state.cache.originalFileExists; + state.host.directoryExists = state.cache.originalDirectoryExists; + state.host.createDirectory = state.cache.originalCreateDirectory; + state.host.writeFile = state.cache.originalWriteFile; + state.compilerHost.getSourceFile = state.cache.originalGetSourceFile; + state.readFileWithCache = state.cache.originalReadFileWithCache; + state.extendedConfigCache.clear(); + state.moduleResolutionCache?.clear(); + state.typeReferenceDirectiveResolutionCache?.clear(); + state.libraryResolutionCache?.clear(); + state.typeRootsCacheKeyMap.clear(); + state.effectiveTypeRoots.clear(); state.cache = undefined; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 099a140ab27ab..ec34db0fd7a94 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -15,6 +15,7 @@ import { Pattern, SymlinkCache, ThisContainer, + TypeRootsCacheKeyOrSpecifiedTypeRoots, } from "./_namespaces/ts.js"; // branded string type used to store absolute, normalized and canonicalized paths @@ -4727,6 +4728,8 @@ export interface Program extends ScriptReferenceHost { callback: (resolution: ResolvedTypeReferenceDirectiveWithFailedLookupLocations, moduleName: string, mode: ResolutionMode, filePath: Path) => void, file?: SourceFile, ): void; + /** @internal */ + getTypeRootsCacheKeys(): Map | undefined; /** * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then @@ -7908,6 +7911,8 @@ export interface ModuleResolutionHost { getDirectories?(path: string): string[]; useCaseSensitiveFileNames?: boolean | (() => boolean) | undefined; /** @internal */ getGlobalTypingsCacheLocation?(): string | undefined; + /** @internal */ getTypeRootsCacheKey?(options: CompilerOptions, redirect: ResolvedProjectReference | undefined): TypeRootsCacheKeyOrSpecifiedTypeRoots; + /** @internal */ getEffectiveTypeRoots?(options: CompilerOptions, redirect: ResolvedProjectReference | undefined): readonly string[] | undefined; } /** diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index 6a00fa119c2f3..44c1338cadf8c 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -41,6 +41,7 @@ import { getBuildInfo, getConfigFileParsingDiagnostics, getDirectoryPath, + getEffectiveTypeRoots as ts_getEffectiveTypeRoots, getFileNamesFromConfigSpecs, getNewLineCharacter, getNormalizedAbsolutePath, @@ -402,6 +403,8 @@ interface ParsedConfig { watchedDirectories?: Map; /** Level of program update to be done for this config file */ updateLevel?: ProgramUpdateLevel.RootNamesAndUpdate | ProgramUpdateLevel.Full; + /** Effective typeroots if calculated and cached */ + effectiveTypeRoots?: readonly string[] | false; } // All of one and partial of the other, or vice versa. @@ -455,6 +458,7 @@ export function createWatchProgram(host: WatchCompiler const currentDirectory = host.getCurrentDirectory(); const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram } = host; let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host; + let effectiveTypeRoots: readonly string[] | false | undefined; let wildcardDirectories: MapLike | undefined; let configFileParsingDiagnostics: Diagnostic[] | undefined; let canConfigFileJsonReportNoInputFiles = false; @@ -516,6 +520,7 @@ export function createWatchProgram(host: WatchCompiler compilerHost.getCurrentProgram = getCurrentProgram; compilerHost.writeLog = writeLog; compilerHost.getParsedCommandLine = getParsedCommandLine; + compilerHost.getEffectiveTypeRoots = getEffectiveTypeRoots; // Cache for the module resolution const resolutionCache = createResolutionCache( @@ -971,6 +976,20 @@ export function createWatchProgram(host: WatchCompiler ); // TODO: GH#18217 } + function getEffectiveTypeRoots(options: CompilerOptions, redirect: ResolvedProjectReference | undefined): readonly string[] | undefined { + if (!redirect) { + if (effectiveTypeRoots === undefined) { + effectiveTypeRoots = ts_getEffectiveTypeRoots(options, compilerHost) ?? false; + } + return effectiveTypeRoots || undefined; + } + const config = parsedConfigs!.get(redirect.sourceFile.path)!; + if (config.effectiveTypeRoots === undefined) { + config.effectiveTypeRoots = ts_getEffectiveTypeRoots(config.parsedCommandLine!.options, compilerHost) ?? false; + } + return config.effectiveTypeRoots || undefined; + } + function setConfigFileParsingResult(configFileParseResult: ParsedCommandLine) { rootFileNames = configFileParseResult.fileNames; compilerOptions = configFileParseResult.options; @@ -980,6 +999,7 @@ export function createWatchProgram(host: WatchCompiler configFileParsingDiagnostics = getConfigFileParsingDiagnostics(configFileParseResult).slice(); canConfigFileJsonReportNoInputFiles = canJsonReportNoInputFiles(configFileParseResult.raw); hasChangedConfigFileParsingErrors = true; + effectiveTypeRoots = undefined; } function getParsedCommandLine(configFileName: string): ParsedCommandLine | undefined { diff --git a/src/harness/incrementalUtils.ts b/src/harness/incrementalUtils.ts index d3e2a6512654d..1ca36f173a6a4 100644 --- a/src/harness/incrementalUtils.ts +++ b/src/harness/incrementalUtils.ts @@ -442,6 +442,7 @@ function populateResolutionCache( path !== inferredTypesPath ? actualProgram.getResolvedTypeReferenceDirective(actualProgram.getSourceFileByPath(path)!, name, mode) : actualProgram.getAutomaticTypeDirectiveResolutions().get(name, mode), + redirect => actualProgram.getTypeRootsCacheKeys()?.get(redirect?.sourceFile.path), ) ); actual.resolvedLibraries.forEach((resolved, libFileName) => { @@ -462,6 +463,7 @@ function populateResolutionCache( undefined, ts.getDirectoryPath(libResolvedFrom), undefined, + undefined, expectedResolution, ); }); @@ -521,6 +523,7 @@ function populateResolutionCache( moduleOrTypeRefCache: ts.ModuleOrTypeReferenceResolutionCache, getRedirectReferenceForResolution: () => ts.ResolvedProjectReference | undefined, getProgramResolutions: (name: string, mode: ts.ResolutionMode) => T | undefined, + getTypeRootsCacheKey?: (redirect: ts.ResolvedProjectReference | undefined) => ts.TypeRootsCacheKeyOrSpecifiedTypeRoots | undefined, ) { if (verifyProgramAndResolution) { ts.Debug.assert( @@ -542,11 +545,13 @@ function populateResolutionCache( ); if (!expectedCache) storeExpected.set(fileName, expectedCache = ts.createModeAwareCache()); expectedCache.set(name, mode, expected); + const redirect = getRedirectReferenceForResolution(); moduleOrTypeRefCache.setPerDirectoryAndNonRelativeNameCacheResult( name, mode, ts.getDirectoryPath(fileName), - getRedirectReferenceForResolution(), + redirect, + getTypeRootsCacheKey?.(redirect), expected as unknown as T, ); if (verifyProgramAndResolution) { @@ -1179,22 +1184,21 @@ export function verifyResolutionCache( (expectedOwnOptions && ts.computeRedirectsCacheKey(expectedOwnOptions)) === (actualOwnOptions && ts.computeRedirectsCacheKey(actualOwnOptions)), `${projectName}:: ${cacheType}:: ownOptions affecting cache should match`, ); - verifyMap( + verifyMapAndTypeRootsCacheKeyMaps( expectedCacheWithRedirects.getOwnMap(), actualCacheWithRedirects.getOwnMap(), - verifyValue, `${cacheType}:: ownMap`, ); + expectedCacheWithRedirects.redirectsKeyToMap.forEach( (expectedCacheWithRedirectsValue, key) => { // Expected might have value in redirectsKeyToMap because we collect and set resolutions // in different order than its computed by program creation const actualCacheWithRedirectsValue = actualCacheWithRedirects.redirectsKeyToMap.get(key); if (actualCacheWithRedirectsValue) { - verifyMap( + verifyMapAndTypeRootsCacheKeyMaps( expectedCacheWithRedirectsValue, actualCacheWithRedirects.redirectsKeyToMap.get(key), - verifyValue, `${cacheType}:: redirectsKeyToMap:: ${key}`, ); } @@ -1216,10 +1220,9 @@ export function verifyResolutionCache( (actualCacheWithRedirectsValue, key) => { const expectedCacheWithRedirectsValue = expectedCacheWithRedirects.redirectsKeyToMap.get(key); if (expectedCacheWithRedirectsValue) { - verifyMap( + verifyMapAndTypeRootsCacheKeyMaps( expectedCacheWithRedirectsValue, actualCacheWithRedirectsValue, - verifyValue, `${cacheType}:: redirectsKeyToMap:: ${key}`, ); } @@ -1238,6 +1241,55 @@ export function verifyResolutionCache( } }, ); + + function verifyMapAndTypeRootsCacheKeyMaps( + expectedRootMap: Map | undefined, + actualRootMap: Map | undefined, + caption: string, + ) { + verifyMapFromCacheSame( + expectedRootMap, + actualRootMap, + caption, + ); + verifyTypeRootsCacheKeyMaps( + expectedCacheWithRedirects, + actualCacheWithRedirects, + verifyMapFromCacheSame, + expectedRootMap, + actualRootMap, + caption, + ); + } + + function verifyMapFromCacheSame( + expctedCacheMap: Map | undefined, + actualCacheMap: Map | undefined, + caption: string, + ) { + verifyMap( + expctedCacheMap, + actualCacheMap, + verifyValue, + caption, + ); + } + } + + function verifyTypeRootsCacheKeyMaps( + expectedCacheWithRedirects: ts.CacheWithRedirects, + actualCacheWithRedirects: ts.CacheWithRedirects, + verifyTypeRootsResultMap: (expectedTypeRootsCacheMap: Map | undefined, actualTypeRootsCacheMap: Map | undefined, caption: string) => void, + expectedKeyMap: Map | undefined, + actualKeyMap: Map | undefined, + caption: string, + ) { + verifyMap( + expectedCacheWithRedirects.getTypesRootKeyToMap()?.get(expectedKeyMap!), + actualCacheWithRedirects.getTypesRootKeyToMap()?.get(actualKeyMap!), + verifyTypeRootsResultMap, + caption, + ); } function verifyModuleOrTypeResolutionCacheIsEmpty( @@ -1279,6 +1331,7 @@ export function verifyResolutionCache( ); } }); + // TODO:: sheetal } function verifyModuleOrTypeResolutionCacheReferencesOnlyOtherCaches( @@ -1286,10 +1339,11 @@ export function verifyResolutionCache( cacheType: ModuleOrTypeRefOrLibraryCacheType, compacted: boolean, ) { + // TODO:: sheetal let allowedKeys: Set | undefined; forEachOtherResolutionCachesInSharedCache(cache => cacheType !== "libraryResolutionCache" ? - actual.sharedCache.cacheToOptions.get(cache)?.forEach( + actual.sharedCache.cacheToOptions.get(cache)?.availableOptions.forEach( options => (allowedKeys ??= new Set()).add( ts.computeRedirectsCacheKey(options), @@ -1319,6 +1373,7 @@ export function verifyResolutionCache( allowedKeys: Set | undefined, compacted: boolean, ) { + // TODO:: sheetal ts.Debug.assert( cacheWithRedirects.getOwnMap().size === 0 || allowedKeys?.has(ts.computeRedirectsCacheKey(cacheWithRedirects.getOwnOptions()!)), `${projectName}:: ${cacheType}:: ${compacted}:: ownMap should be empty`, diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index f4f9a2d88dc9e..3d299a6156984 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1163,6 +1163,7 @@ export interface ParsedConfig { */ watchedDirectoriesStale?: boolean; updateLevel?: ProgramUpdateLevel.RootNamesAndUpdate | ProgramUpdateLevel.Full; + effectiveTypeRoots?: readonly string[] | false; } function createProjectNameFactoryWithCounter(nameFactory: (counter: number) => string) { @@ -3024,6 +3025,7 @@ export class ProjectService { configFileExistenceInfo.config.watchedDirectoriesStale = true; configFileExistenceInfo.config.updateLevel = undefined; } + configFileExistenceInfo.config.effectiveTypeRoots = undefined; // If watch options different than older options when setting for the first time, update the config file watcher if ( diff --git a/src/server/project.ts b/src/server/project.ts index 635f0f8d11fd6..083a271bb07b4 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -479,6 +479,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo /** @internal */ useSourceOfProjectReferenceRedirect?(): boolean; /** @internal */ getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined; + /** @internal */ getEffectiveTypeRoots?(options: CompilerOptions, redirect: ResolvedProjectReference | undefined): readonly string[] | undefined; private readonly cancellationToken: ThrottledCancellationToken; @@ -575,6 +576,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo /** @internal*/ preferNonRecursiveWatch: boolean | undefined; readonly jsDocParsingMode: JSDocParsingMode | undefined; + private compilerHost?: CompilerHost; /** @internal */ constructor( @@ -656,6 +658,16 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo this.projectService.onProjectCreation(this); } + /** @internal */ + setCompilerHost(host: CompilerHost): void { + this.compilerHost = host; + } + + /** @internal */ + getCompilerHost(): CompilerHost | undefined { + return this.compilerHost; + } + isKnownTypesPackageName(name: string): boolean { return this.projectService.typingsInstaller.isKnownTypesPackageName(name); } @@ -1198,6 +1210,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo } close(): void { + this.compilerHost = undefined; if (this.typingsCache) this.projectService.typingsInstaller.onProjectClosed(this); this.typingsCache = undefined; this.closeWatchingTypingLocations(); @@ -1754,6 +1767,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo tracing?.push(tracing.Phase.Session, "finishCachingPerDirectoryResolution"); this.resolutionCache.finishCachingPerDirectoryResolution(this.program, oldProgram); tracing?.pop(); + this.compilerHost = undefined; Debug.assert(oldProgram === undefined || this.program !== undefined); @@ -3008,8 +3022,6 @@ export class ConfiguredProject extends Project { /** @internal */ sendLoadingProjectFinish = false; - private compilerHost?: CompilerHost; - /** @internal */ configDiagDiagnosticsReported?: number; @@ -3043,16 +3055,6 @@ export class ConfiguredProject extends Project { this.pendingUpdateReason = pendingUpdateReason; } - /** @internal */ - setCompilerHost(host: CompilerHost): void { - this.compilerHost = host; - } - - /** @internal */ - getCompilerHost(): CompilerHost | undefined { - return this.compilerHost; - } - /** @internal */ override useSourceOfProjectReferenceRedirect(): boolean { return this.languageServiceEnabled; @@ -3111,7 +3113,6 @@ export class ConfiguredProject extends Project { default: result = super.updateGraph(); } - this.compilerHost = undefined; this.projectService.sendProjectLoadingFinishEvent(this); this.projectService.sendProjectTelemetry(this); if ( @@ -3219,7 +3220,6 @@ export class ConfiguredProject extends Project { this.projectService.configFileExistenceInfoCache.forEach((_configFileExistenceInfo, canonicalConfigFilePath) => this.releaseParsedConfig(canonicalConfigFilePath)); this.projectErrors = undefined; this.openFileWatchTriggered.clear(); - this.compilerHost = undefined; super.close(); } @@ -3234,8 +3234,18 @@ export class ConfiguredProject extends Project { return !!this.deferredClose; } - getEffectiveTypeRoots(): string[] { - return getEffectiveTypeRoots(this.getCompilationSettings(), this) || []; + /** @internal */ + override getEffectiveTypeRoots( + options: CompilerOptions, + redirect: ResolvedProjectReference | undefined, + ): readonly string[] | undefined { + const path = !redirect ? this.canonicalConfigFilePath : redirect.sourceFile.path as unknown as NormalizedPath; + const configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(path)!; + let result = configFileExistenceInfo.config!.effectiveTypeRoots; + if (result === undefined) { + result = configFileExistenceInfo.config!.effectiveTypeRoots = getEffectiveTypeRoots(options, this) ?? false; + } + return result || undefined; } /** @internal */ diff --git a/src/services/services.ts b/src/services/services.ts index 1120828bb0cb6..ce54c55b8a171 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1778,6 +1778,7 @@ export function createLanguageService( onSourceFileNotCreated: maybeBind(host, host.onSourceFileNotCreated), useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect), getParsedCommandLine, + getEffectiveTypeRoots: maybeBind(host, host.getEffectiveTypeRoots), jsDocParsingMode: host.jsDocParsingMode, getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation), }; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 98a18a993a437..aec35d42595d3 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3033,7 +3033,6 @@ declare namespace ts { getAllProjectErrors(): readonly Diagnostic[]; setProjectErrors(projectErrors: Diagnostic[]): void; close(): void; - getEffectiveTypeRoots(): string[]; } /** * Project whose configuration is handled externally, such as in a '.csproj'. diff --git a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-only-one-with-typeRoots.js b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-only-one-with-typeRoots.js index 7bf8a54302f20..141f5a527c204 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-only-one-with-typeRoots.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-only-one-with-typeRoots.js @@ -111,9 +111,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' @@ -331,9 +329,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' diff --git a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-common-@types-with-types.js b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-common-@types-with-types.js index 1d673d9abe139..accb3622865ce 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-common-@types-with-types.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-common-@types-with-types.js @@ -118,10 +118,7 @@ node_modules/@types/responselike/index.d.ts ======== Resolving type reference directive 'responselike', containing file '/home/src/workspaces/project/test/module/ts/__inferred type names__.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -File '/home/src/workspaces/project/node_modules/@types/responselike/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. +Resolution for type reference directive 'responselike' was found in cache from location '/home/src/workspaces/project/test/module'. ======== Type reference directive 'responselike' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', primary: true. ======== File '/home/src/workspaces/project/node_modules/@types/responselike/package.json' does not exist according to earlier cached lookups. File '/home/src/workspaces/project/node_modules/@types/package.json' does not exist according to earlier cached lookups. @@ -131,8 +128,13 @@ File '/home/src/workspaces/package.json' does not exist according to earlier cac File '/home/src/package.json' does not exist according to earlier cached lookups. File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. -======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. ======== -Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/node_modules/@types/responselike'. +======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. +File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. File '/home/src/workspaces/project/test/node_modules/@types/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-common-@types.js b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-common-@types.js index 19c7095ebc78c..b0dad4ace55f2 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-common-@types.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-common-@types.js @@ -97,11 +97,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts-require/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -Directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts-require'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' @@ -121,18 +117,12 @@ node_modules/@types/responselike/index.d.ts ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/test/module/ts/__inferred type names__.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== ======== Resolving type reference directive 'responselike', containing file '/home/src/workspaces/project/test/module/ts/__inferred type names__.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -File '/home/src/workspaces/project/node_modules/@types/responselike/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. +Resolution for type reference directive 'responselike' was found in cache from location '/home/src/workspaces/project/test/module'. ======== Type reference directive 'responselike' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', primary: true. ======== File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. File '/home/src/workspaces/project/test/node_modules/@types/package.json' does not exist according to earlier cached lookups. @@ -151,8 +141,9 @@ File '/home/src/workspaces/package.json' does not exist according to earlier cac File '/home/src/package.json' does not exist according to earlier cached lookups. File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. -======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. ======== -Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/node_modules/@types/responselike'. +======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' @@ -402,11 +393,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' @@ -563,11 +550,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts-require/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -Directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts-require'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' diff --git a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-discrepancies.js b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-discrepancies.js deleted file mode 100644 index 1585df8d87b9a..0000000000000 --- a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-discrepancies.js +++ /dev/null @@ -1,1032 +0,0 @@ -0:: build ts project with edit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "./node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion" -} -Incremental signature is neither dts signature nor file version for File:: ../ts-require/node_modules/@types/node/index.d.ts -Incremental:: undefined -Clean:: { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" -} -Dts Signature:: undefined -Incremental build does not contain ./node_modules/@types/node/index.d.ts file for semantic errors, clean build has semantic errors: /home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt:: -Incremental buildInfoText:: { - "fileNames": [ - "../../../../../tslibs/ts/lib/lib.d.ts", - "./index.ts", - "./main.ts", - "./node_modules/@types/node/index.d.ts", - "../../../node_modules/@types/responselike/index.d.ts" - ], - "fileIdsList": [ - [ - "./node_modules/@types/node/index.d.ts" - ] - ], - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "original": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, - "./main.ts": { - "original": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n" - }, - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n" - }, - "./node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "original": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": 1 - }, - "version": "4670743798-/// \nexport const z = 10;\n", - "signature": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "./node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1237 -} -Clean buildInfoText:: { - "fileNames": [ - "../../../../../tslibs/ts/lib/lib.d.ts", - "./index.ts", - "./main.ts", - "./node_modules/@types/node/index.d.ts", - "../ts-require/node_modules/@types/node/index.d.ts", - "../../../node_modules/@types/responselike/index.d.ts" - ], - "fileIdsList": [ - [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - ], - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "original": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": 1 - }, - "version": "4670743798-/// \nexport const z = 10;\n", - "signature": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - [ - "./node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "../ts-require/node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ], - [ - "../ts-require/node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "./node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ] - ], - "version": "FakeTSVersion", - "size": 1875 -} -Incremental build does not contain ../ts-require/node_modules/@types/node/index.d.ts file for semantic errors, clean build has semantic errors: /home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt:: -Incremental buildInfoText:: { - "fileNames": [ - "../../../../../tslibs/ts/lib/lib.d.ts", - "./index.ts", - "./main.ts", - "./node_modules/@types/node/index.d.ts", - "../../../node_modules/@types/responselike/index.d.ts" - ], - "fileIdsList": [ - [ - "./node_modules/@types/node/index.d.ts" - ] - ], - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "original": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, - "./main.ts": { - "original": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n" - }, - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n" - }, - "./node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "original": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": 1 - }, - "version": "4670743798-/// \nexport const z = 10;\n", - "signature": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "./node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1237 -} -Clean buildInfoText:: { - "fileNames": [ - "../../../../../tslibs/ts/lib/lib.d.ts", - "./index.ts", - "./main.ts", - "./node_modules/@types/node/index.d.ts", - "../ts-require/node_modules/@types/node/index.d.ts", - "../../../node_modules/@types/responselike/index.d.ts" - ], - "fileIdsList": [ - [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - ], - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "original": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": 1 - }, - "version": "4670743798-/// \nexport const z = 10;\n", - "signature": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - [ - "./node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "../ts-require/node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ], - [ - "../ts-require/node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "./node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ] - ], - "version": "FakeTSVersion", - "size": 1875 -} -1:: build ts-require project with edit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "./node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion" -} -Incremental signature is neither dts signature nor file version for File:: ../ts-require/node_modules/@types/node/index.d.ts -Incremental:: undefined -Clean:: { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" -} -Dts Signature:: undefined -Incremental build does not contain ./node_modules/@types/node/index.d.ts file for semantic errors, clean build has semantic errors: /home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt:: -Incremental buildInfoText:: { - "fileNames": [ - "../../../../../tslibs/ts/lib/lib.d.ts", - "./index.ts", - "./main.ts", - "./node_modules/@types/node/index.d.ts", - "../../../node_modules/@types/responselike/index.d.ts" - ], - "fileIdsList": [ - [ - "./node_modules/@types/node/index.d.ts" - ] - ], - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "original": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, - "./main.ts": { - "original": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n" - }, - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n" - }, - "./node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "original": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": 1 - }, - "version": "4670743798-/// \nexport const z = 10;\n", - "signature": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "./node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1237 -} -Clean buildInfoText:: { - "fileNames": [ - "../../../../../tslibs/ts/lib/lib.d.ts", - "./index.ts", - "./main.ts", - "./node_modules/@types/node/index.d.ts", - "../ts-require/node_modules/@types/node/index.d.ts", - "../../../node_modules/@types/responselike/index.d.ts" - ], - "fileIdsList": [ - [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - ], - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "original": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": 1 - }, - "version": "4670743798-/// \nexport const z = 10;\n", - "signature": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - [ - "./node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "../ts-require/node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ], - [ - "../ts-require/node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "./node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ] - ], - "version": "FakeTSVersion", - "size": 1875 -} -Incremental build does not contain ../ts-require/node_modules/@types/node/index.d.ts file for semantic errors, clean build has semantic errors: /home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt:: -Incremental buildInfoText:: { - "fileNames": [ - "../../../../../tslibs/ts/lib/lib.d.ts", - "./index.ts", - "./main.ts", - "./node_modules/@types/node/index.d.ts", - "../../../node_modules/@types/responselike/index.d.ts" - ], - "fileIdsList": [ - [ - "./node_modules/@types/node/index.d.ts" - ] - ], - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "original": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, - "./main.ts": { - "original": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n" - }, - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n" - }, - "./node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "original": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": 1 - }, - "version": "4670743798-/// \nexport const z = 10;\n", - "signature": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "./node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1237 -} -Clean buildInfoText:: { - "fileNames": [ - "../../../../../tslibs/ts/lib/lib.d.ts", - "./index.ts", - "./main.ts", - "./node_modules/@types/node/index.d.ts", - "../ts-require/node_modules/@types/node/index.d.ts", - "../../../node_modules/@types/responselike/index.d.ts" - ], - "fileIdsList": [ - [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - ], - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "original": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;", - "signature": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "original": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": 1 - }, - "version": "4670743798-/// \nexport const z = 10;\n", - "signature": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - [ - "./node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "../ts-require/node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ], - [ - "../ts-require/node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "./node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ] - ], - "version": "FakeTSVersion", - "size": 1875 -} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-with-types-discrepancies.js b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-with-types-discrepancies.js deleted file mode 100644 index 2c1339d7626d7..0000000000000 --- a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-with-types-discrepancies.js +++ /dev/null @@ -1,222 +0,0 @@ -0:: build ts project with edit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "./node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion" -} -Incremental signature is neither dts signature nor file version for File:: ../ts-require/node_modules/@types/node/index.d.ts -Incremental:: undefined -Clean:: { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" -} -Dts Signature:: undefined -Incremental signature is neither dts signature nor file version for File:: ./node_modules/@types/node/index.d.ts -Incremental:: { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" -} -Clean:: undefined -Dts Signature:: undefined -1:: build ts-require project with edit -*** Needs explanation -TsBuild info text without affectedFilesPendingEmit:: /home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt:: -CleanBuild: -{ - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion" -} -IncrementalBuild: -{ - "fileInfos": { - "../../../../../tslibs/ts/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./index.ts": { - "version": "-13547799514-export const tsIndex= 10;" - }, - "./main.ts": { - "version": "-8570461073-export const tsMain = 10;export const z = 10;" - }, - "./node_modules/@types/node/index.d.ts": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, - "../../../node_modules/@types/responselike/index.d.ts": { - "version": "4670743798-/// \nexport const z = 10;\n", - "impliedFormat": "commonjs" - } - }, - "root": [ - [ - 2, - "./index.ts" - ], - [ - 3, - "./main.ts" - ] - ], - "referencedMap": { - "../../../node_modules/@types/responselike/index.d.ts": [ - "./node_modules/@types/node/index.d.ts" - ] - }, - "version": "FakeTSVersion" -} -Incremental signature is neither dts signature nor file version for File:: ../ts-require/node_modules/@types/node/index.d.ts -Incremental:: undefined -Clean:: { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" -} -Dts Signature:: undefined -Incremental signature is neither dts signature nor file version for File:: ./node_modules/@types/node/index.d.ts -Incremental:: { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" -} -Clean:: undefined -Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-with-types.js b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-with-types.js index 6669a71cffe15..97b167a2ba8e5 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-with-types.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified-with-types.js @@ -134,13 +134,16 @@ File '/home/src/workspaces/package.json' does not exist according to earlier cac File '/home/src/package.json' does not exist according to earlier cached lookups. File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. -======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. ======== -Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/node_modules/@types/responselike'. -======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== -File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts-require/node_modules/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts-require/package.json' does not exist according to earlier cached lookups. +======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist. +File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts'. +======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== +File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspaces/project/test/module/ts/node_modules/@types/package.json' does not exist. +File '/home/src/workspaces/project/test/module/ts/node_modules/package.json' does not exist. +File '/home/src/workspaces/project/test/module/ts/package.json' does not exist. File '/home/src/workspaces/project/test/module/package.json' does not exist according to earlier cached lookups. File '/home/src/workspaces/project/test/package.json' does not exist according to earlier cached lookups. File '/home/src/workspaces/project/package.json' does not exist according to earlier cached lookups. @@ -154,7 +157,7 @@ test/module/ts/index.ts Matched by default include pattern '**/*' test/module/ts/main.ts Matched by default include pattern '**/*' -test/module/ts-require/node_modules/@types/node/index.d.ts +test/module/ts/node_modules/@types/node/index.d.ts Type library referenced via 'node' from file 'node_modules/@types/responselike/index.d.ts' node_modules/@types/responselike/index.d.ts Entry point of type library 'responselike' specified in compilerOptions @@ -264,7 +267,7 @@ exports.tsMain = 10; //// [/home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../tslibs/ts/lib/lib.d.ts","./index.ts","./main.ts","../ts-require/node_modules/@types/node/index.d.ts","../../../node_modules/@types/responselike/index.d.ts"],"fileIdsList":[[4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13547799514-export const tsIndex= 10;","-10684672141-export const tsMain = 10;",{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"4670743798-/// \nexport const z = 10;\n","impliedFormat":1}],"root":[2,3],"referencedMap":[[5,1]],"version":"FakeTSVersion"} +{"fileNames":["../../../../../tslibs/ts/lib/lib.d.ts","./index.ts","./main.ts","./node_modules/@types/node/index.d.ts","../../../node_modules/@types/responselike/index.d.ts"],"fileIdsList":[[4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13547799514-export const tsIndex= 10;","-10684672141-export const tsMain = 10;",{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"4670743798-/// \nexport const z = 10;\n","impliedFormat":1}],"root":[2,3],"referencedMap":[[5,1]],"version":"FakeTSVersion"} //// [/home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -272,12 +275,12 @@ exports.tsMain = 10; "../../../../../tslibs/ts/lib/lib.d.ts", "./index.ts", "./main.ts", - "../ts-require/node_modules/@types/node/index.d.ts", + "./node_modules/@types/node/index.d.ts", "../../../node_modules/@types/responselike/index.d.ts" ], "fileIdsList": [ [ - "../ts-require/node_modules/@types/node/index.d.ts" + "./node_modules/@types/node/index.d.ts" ] ], "fileInfos": { @@ -298,7 +301,7 @@ exports.tsMain = 10; "version": "-10684672141-export const tsMain = 10;", "signature": "-10684672141-export const tsMain = 10;" }, - "../ts-require/node_modules/@types/node/index.d.ts": { + "./node_modules/@types/node/index.d.ts": { "original": { "version": "-4340658070-declare const tsRequireGlobal = 10;", "affectsGlobalScope": true, @@ -331,11 +334,11 @@ exports.tsMain = 10; ], "referencedMap": { "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" + "./node_modules/@types/node/index.d.ts" ] }, "version": "FakeTSVersion", - "size": 1051 + "size": 1039 } @@ -405,7 +408,6 @@ node_modules/@types/responselike/index.d.ts Entry point of type library 'responselike' specified in compilerOptions -//// [/home/src/workspaces/project/test/module/ts/index.js] file written with same contents //// [/home/src/workspaces/project/test/module/ts/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -415,7 +417,7 @@ exports.z = 10; //// [/home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../tslibs/ts/lib/lib.d.ts","./index.ts","./main.ts","./node_modules/@types/node/index.d.ts","../../../node_modules/@types/responselike/index.d.ts"],"fileIdsList":[[4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-13547799514-export const tsIndex= 10;","signature":"-3096057536-export declare const tsIndex = 10;\n"},{"version":"-8570461073-export const tsMain = 10;export const z = 10;","signature":"-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n"},{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"4670743798-/// \nexport const z = 10;\n","impliedFormat":1}],"root":[2,3],"referencedMap":[[5,1]],"version":"FakeTSVersion"} +{"fileNames":["../../../../../tslibs/ts/lib/lib.d.ts","./index.ts","./main.ts","./node_modules/@types/node/index.d.ts","../../../node_modules/@types/responselike/index.d.ts"],"fileIdsList":[[4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13547799514-export const tsIndex= 10;",{"version":"-8570461073-export const tsMain = 10;export const z = 10;","signature":"-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n"},{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"4670743798-/// \nexport const z = 10;\n","impliedFormat":1}],"root":[2,3],"referencedMap":[[5,1]],"version":"FakeTSVersion"} //// [/home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -442,12 +444,8 @@ exports.z = 10; "affectsGlobalScope": true }, "./index.ts": { - "original": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" + "signature": "-13547799514-export const tsIndex= 10;" }, "./main.ts": { "original": { @@ -494,7 +492,7 @@ exports.z = 10; ] }, "version": "FakeTSVersion", - "size": 1237 + "size": 1162 } diff --git a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified.js b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified.js index c6dfe2f268609..c49070c8cd955 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/typeRef-resolutions-with-typeRoots-unspecified.js @@ -100,9 +100,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts-require/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts-require'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' @@ -152,40 +150,10 @@ File '/home/src/workspaces/package.json' does not exist according to earlier cac File '/home/src/package.json' does not exist according to earlier cached lookups. File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. -======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. ======== -Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/node_modules/@types/responselike'. -======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== -File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts-require/node_modules/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts-require/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/package.json' does not exist according to earlier cached lookups. -File '/home/src/package.json' does not exist according to earlier cached lookups. -File '/home/package.json' does not exist according to earlier cached lookups. -File '/package.json' does not exist according to earlier cached lookups. -test/module/ts-require/node_modules/@types/node/index.d.ts:1:15 - error TS2451: Cannot redeclare block-scoped variable 'tsRequireGlobal'. - -1 declare const tsRequireGlobal = 10; -   ~~~~~~~~~~~~~~~ - - test/module/ts/node_modules/@types/node/index.d.ts:1:15 - 1 declare const tsRequireGlobal = 10; -    ~~~~~~~~~~~~~~~ - 'tsRequireGlobal' was also declared here. - -test/module/ts/node_modules/@types/node/index.d.ts:1:15 - error TS2451: Cannot redeclare block-scoped variable 'tsRequireGlobal'. - -1 declare const tsRequireGlobal = 10; -   ~~~~~~~~~~~~~~~ - - test/module/ts-require/node_modules/@types/node/index.d.ts:1:15 - 1 declare const tsRequireGlobal = 10; -    ~~~~~~~~~~~~~~~ - 'tsRequireGlobal' was also declared here. - +======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. +======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' test/module/ts/index.ts @@ -194,13 +162,9 @@ test/module/ts/main.ts Matched by default include pattern '**/*' test/module/ts/node_modules/@types/node/index.d.ts Entry point for implicit type library 'node' -test/module/ts-require/node_modules/@types/node/index.d.ts Type library referenced via 'node' from file 'node_modules/@types/responselike/index.d.ts' node_modules/@types/responselike/index.d.ts Entry point for implicit type library 'responselike' - -Found 2 errors. - //// [/home/src/workspaces/project/test/module/ts-require/index.js] @@ -307,7 +271,7 @@ exports.tsMain = 10; //// [/home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../tslibs/ts/lib/lib.d.ts","./index.ts","./main.ts","./node_modules/@types/node/index.d.ts","../ts-require/node_modules/@types/node/index.d.ts","../../../node_modules/@types/responselike/index.d.ts"],"fileIdsList":[[5]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13547799514-export const tsIndex= 10;","-10684672141-export const tsMain = 10;",{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"4670743798-/// \nexport const z = 10;\n","impliedFormat":1}],"root":[2,3],"referencedMap":[[6,1]],"semanticDiagnosticsPerFile":[[4,[{"start":14,"length":15,"messageText":"Cannot redeclare block-scoped variable 'tsRequireGlobal'.","category":1,"code":2451,"relatedInformation":[{"file":"../ts-require/node_modules/@types/node/index.d.ts","start":14,"length":15,"messageText":"'tsRequireGlobal' was also declared here.","category":3,"code":6203}]}]],[5,[{"start":14,"length":15,"messageText":"Cannot redeclare block-scoped variable 'tsRequireGlobal'.","category":1,"code":2451,"relatedInformation":[{"file":"./node_modules/@types/node/index.d.ts","start":14,"length":15,"messageText":"'tsRequireGlobal' was also declared here.","category":3,"code":6203}]}]]],"version":"FakeTSVersion"} +{"fileNames":["../../../../../tslibs/ts/lib/lib.d.ts","./index.ts","./main.ts","./node_modules/@types/node/index.d.ts","../../../node_modules/@types/responselike/index.d.ts"],"fileIdsList":[[4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13547799514-export const tsIndex= 10;","-10684672141-export const tsMain = 10;",{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"4670743798-/// \nexport const z = 10;\n","impliedFormat":1}],"root":[2,3],"referencedMap":[[5,1]],"version":"FakeTSVersion"} //// [/home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -316,12 +280,11 @@ exports.tsMain = 10; "./index.ts", "./main.ts", "./node_modules/@types/node/index.d.ts", - "../ts-require/node_modules/@types/node/index.d.ts", "../../../node_modules/@types/responselike/index.d.ts" ], "fileIdsList": [ [ - "../ts-require/node_modules/@types/node/index.d.ts" + "./node_modules/@types/node/index.d.ts" ] ], "fileInfos": { @@ -353,17 +316,6 @@ exports.tsMain = 10; "affectsGlobalScope": true, "impliedFormat": "commonjs" }, - "../ts-require/node_modules/@types/node/index.d.ts": { - "original": { - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "version": "-4340658070-declare const tsRequireGlobal = 10;", - "signature": "-4340658070-declare const tsRequireGlobal = 10;", - "affectsGlobalScope": true, - "impliedFormat": "commonjs" - }, "../../../node_modules/@types/responselike/index.d.ts": { "original": { "version": "4670743798-/// \nexport const z = 10;\n", @@ -386,61 +338,15 @@ exports.tsMain = 10; ], "referencedMap": { "../../../node_modules/@types/responselike/index.d.ts": [ - "../ts-require/node_modules/@types/node/index.d.ts" + "./node_modules/@types/node/index.d.ts" ] }, - "semanticDiagnosticsPerFile": [ - [ - "./node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "../ts-require/node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ], - [ - "../ts-require/node_modules/@types/node/index.d.ts", - [ - { - "start": 14, - "length": 15, - "messageText": "Cannot redeclare block-scoped variable 'tsRequireGlobal'.", - "category": 1, - "code": 2451, - "relatedInformation": [ - { - "file": "./node_modules/@types/node/index.d.ts", - "start": 14, - "length": 15, - "messageText": "'tsRequireGlobal' was also declared here.", - "category": 3, - "code": 6203 - } - ] - } - ] - ] - ], "version": "FakeTSVersion", - "size": 1856 + "size": 1039 } -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +exitCode:: ExitStatus.Success Change:: build ts project with edit @@ -457,7 +363,7 @@ Output:: [HH:MM:SS AM] Project 'test/module/ts-require/tsconfig.json' is up to date because newest input 'test/module/ts-require/main.ts' is older than output 'test/module/ts-require/tsconfig.tsbuildinfo' -[HH:MM:SS AM] Project 'test/module/ts/tsconfig.json' is out of date because buildinfo file 'test/module/ts/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'test/module/ts/tsconfig.json' is out of date because output 'test/module/ts/tsconfig.tsbuildinfo' is older than input 'test/module/ts/main.ts' [HH:MM:SS AM] Building project '/home/src/workspaces/project/test/module/ts/tsconfig.json'... @@ -496,9 +402,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' @@ -513,7 +417,6 @@ node_modules/@types/responselike/index.d.ts Entry point for implicit type library 'responselike' -//// [/home/src/workspaces/project/test/module/ts/index.js] file written with same contents //// [/home/src/workspaces/project/test/module/ts/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -523,7 +426,7 @@ exports.z = 10; //// [/home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo] -{"fileNames":["../../../../../tslibs/ts/lib/lib.d.ts","./index.ts","./main.ts","./node_modules/@types/node/index.d.ts","../../../node_modules/@types/responselike/index.d.ts"],"fileIdsList":[[4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-13547799514-export const tsIndex= 10;","signature":"-3096057536-export declare const tsIndex = 10;\n"},{"version":"-8570461073-export const tsMain = 10;export const z = 10;","signature":"-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n"},{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"4670743798-/// \nexport const z = 10;\n","impliedFormat":1}],"root":[2,3],"referencedMap":[[5,1]],"version":"FakeTSVersion"} +{"fileNames":["../../../../../tslibs/ts/lib/lib.d.ts","./index.ts","./main.ts","./node_modules/@types/node/index.d.ts","../../../node_modules/@types/responselike/index.d.ts"],"fileIdsList":[[4]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13547799514-export const tsIndex= 10;",{"version":"-8570461073-export const tsMain = 10;export const z = 10;","signature":"-7988574173-export declare const tsMain = 10;\nexport declare const z = 10;\n"},{"version":"-4340658070-declare const tsRequireGlobal = 10;","affectsGlobalScope":true,"impliedFormat":1},{"version":"4670743798-/// \nexport const z = 10;\n","impliedFormat":1}],"root":[2,3],"referencedMap":[[5,1]],"version":"FakeTSVersion"} //// [/home/src/workspaces/project/test/module/ts/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -550,12 +453,8 @@ exports.z = 10; "affectsGlobalScope": true }, "./index.ts": { - "original": { - "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" - }, "version": "-13547799514-export const tsIndex= 10;", - "signature": "-3096057536-export declare const tsIndex = 10;\n" + "signature": "-13547799514-export const tsIndex= 10;" }, "./main.ts": { "original": { @@ -602,7 +501,7 @@ exports.z = 10; ] }, "version": "FakeTSVersion", - "size": 1237 + "size": 1162 } @@ -660,9 +559,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Resolving with primary search path '/home/src/workspaces/project/test/module/ts-require/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts'. +Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts-require'. ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'es5' diff --git a/tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js b/tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js index 3f51269ef7ffc..c897b0bbb8ef9 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js @@ -307,7 +307,8 @@ File '/user/username/projects/package.json' does not exist according to earlier File '/user/username/package.json' does not exist according to earlier cached lookups. File '/user/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. -======== Resolving type reference directive 'pkg', containing file '/user/username/projects/myproject/a.ts'. ======== +======== Resolving type reference directive 'pkg', containing file '/user/username/projects/myproject/a.ts', root directory '/user/username/projects/myproject/node_modules/@types,/user/username/projects/node_modules/@types,/user/username/node_modules/@types,/user/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/user/username/projects/myproject/node_modules/@types, /user/username/projects/node_modules/@types, /user/username/node_modules/@types, /user/node_modules/@types, /node_modules/@types'. Resolution for type reference directive 'pkg' was found in cache from location '/user/username/projects/myproject'. ======== Type reference directive 'pkg' was successfully resolved to '/user/username/projects/myproject/node_modules/pkg/import.d.ts' with Package ID 'pkg/import.d.ts@0.0.1', primary: false. ======== File '/user/username/projects/myproject/node_modules/pkg/package.json' exists according to earlier cached lookups. diff --git a/tests/baselines/reference/tscWatch/resolutionCache/project-with-imports.js b/tests/baselines/reference/tscWatch/resolutionCache/project-with-imports.js index a2f88857edd9a..5f6ab54bb1bc7 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/project-with-imports.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/project-with-imports.js @@ -684,7 +684,8 @@ Reusing resolution of type reference directive 'pkg2' from '/home/src/workspaces Reusing resolution of type reference directive 'pkg3' from '/home/src/workspaces/project/fileWithTypeRefs.ts' of old program, it was not resolved. File '/home/src/workspaces/project/node_modules/pkg2/package.json' exists according to earlier cached lookups. Reusing resolution of module 'pkg0' from '/home/src/workspaces/project/randomFileForImport.ts' of old program, it was successfully resolved to '/home/src/workspaces/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. -======== Resolving type reference directive 'pkg2', containing file '/home/src/workspaces/project/randomFileForTypeRef.ts'. ======== +======== Resolving type reference directive 'pkg2', containing file '/home/src/workspaces/project/randomFileForTypeRef.ts', root directory '/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. Resolution for type reference directive 'pkg2' was found in cache from location '/home/src/workspaces/project'. ======== Type reference directive 'pkg2' was successfully resolved to '/home/src/workspaces/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ======== Reusing resolution of type reference directive 'pkg4' from '/home/src/workspaces/project/__inferred type names__.ts' of old program, it was successfully resolved to '/home/src/workspaces/project/node_modules/@types/pkg4/index.d.ts'. diff --git a/tests/baselines/reference/tsserver/cachingFileSystemInformation/loads-missing-files-from-disk.js b/tests/baselines/reference/tsserver/cachingFileSystemInformation/loads-missing-files-from-disk.js index 8a0e075f92f00..d8e06caef7c34 100644 --- a/tests/baselines/reference/tsserver/cachingFileSystemInformation/loads-missing-files-from-disk.js +++ b/tests/baselines/reference/tsserver/cachingFileSystemInformation/loads-missing-files-from-disk.js @@ -299,23 +299,23 @@ Info seq [hh:mm:ss:mss] fileExists:: [ Info seq [hh:mm:ss:mss] directoryExists:: [ { "key": "/users/username/projects/project", - "count": 3 + "count": 2 }, { "key": "/users/username/projects", - "count": 3 + "count": 2 }, { "key": "/users/username", - "count": 2 + "count": 1 }, { "key": "/users", - "count": 2 + "count": 1 }, { "key": "/", - "count": 2 + "count": 1 }, { "key": "/users/username/projects/project/node_modules", diff --git a/tests/baselines/reference/tsserver/cachingFileSystemInformation/works-using-legacy-resolution-logic.js b/tests/baselines/reference/tsserver/cachingFileSystemInformation/works-using-legacy-resolution-logic.js index fdccd27333c9b..3d2dd2150f4ae 100644 --- a/tests/baselines/reference/tsserver/cachingFileSystemInformation/works-using-legacy-resolution-logic.js +++ b/tests/baselines/reference/tsserver/cachingFileSystemInformation/works-using-legacy-resolution-logic.js @@ -342,31 +342,31 @@ Info seq [hh:mm:ss:mss] fileExists:: [ Info seq [hh:mm:ss:mss] directoryExists:: [ { "key": "/user/username/projects/project/c/d", - "count": 2 + "count": 1 }, { "key": "/user/username/projects/project/c", - "count": 3 + "count": 2 }, { "key": "/user/username/projects/project", - "count": 3 + "count": 2 }, { "key": "/user/username/projects", - "count": 3 + "count": 2 }, { "key": "/user/username", - "count": 2 + "count": 1 }, { "key": "/user", - "count": 2 + "count": 1 }, { "key": "/", - "count": 2 + "count": 1 }, { "key": "/user/username/projects/project/c/d/node_modules", diff --git a/tests/baselines/reference/tsserver/projects/does-not-look-beyond-node_modules-folders-for-default-configured-projects.js b/tests/baselines/reference/tsserver/projects/does-not-look-beyond-node_modules-folders-for-default-configured-projects.js index a46cb171995b6..57849ec437bc5 100644 --- a/tests/baselines/reference/tsserver/projects/does-not-look-beyond-node_modules-folders-for-default-configured-projects.js +++ b/tests/baselines/reference/tsserver/projects/does-not-look-beyond-node_modules-folders-for-default-configured-projects.js @@ -273,10 +273,6 @@ Info seq [hh:mm:ss:mss] event: Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/a 1 undefined Config: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Wild card directory Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/a 1 undefined Config: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Wild card directory Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/projects/project/node_modules/@types/a/tsconfig.json -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/a/node_modules 1 undefined Project: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/a/node_modules 1 undefined Project: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/a 0 undefined Project: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/a 0 undefined Project: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/a/node_modules/@types 1 undefined Project: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/a/node_modules/@types 1 undefined Project: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/node_modules/@types 1 undefined Project: /home/src/projects/project/node_modules/@types/a/tsconfig.json WatchType: Type roots @@ -392,8 +388,6 @@ PolledWatches:: {"pollingInterval":500} /home/src/projects/package.json: {"pollingInterval":2000} -/home/src/projects/project/node_modules/@types/a/node_modules: *new* - {"pollingInterval":500} /home/src/projects/project/node_modules/@types/a/node_modules/@types: *new* {"pollingInterval":500} /home/src/projects/project/node_modules/@types/a/package.json: @@ -412,8 +406,6 @@ PolledWatches:: {"pollingInterval":2000} FsWatches:: -/home/src/projects/project/node_modules/@types/a: *new* - {} /home/src/projects/project/node_modules/@types/a/tsconfig.json: *new* {} /home/src/projects/project/tsconfig.json: diff --git a/tests/baselines/reference/tsserver/resolutionCache/effective-type-roots-affect-type-reference-directives.js b/tests/baselines/reference/tsserver/resolutionCache/effective-type-roots-affect-type-reference-directives.js index bbed85726735c..88d320924bba5 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/effective-type-roots-affect-type-reference-directives.js +++ b/tests/baselines/reference/tsserver/resolutionCache/effective-type-roots-affect-type-reference-directives.js @@ -132,9 +132,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /users/username/p Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /users/username/projects/replay/axios-src/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/users/username/projects/replay/axios-src/node_modules/@types/responselike/index.d.ts', root directory '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types,/users/username/projects/replay/axios-src/test/module/node_modules/@types,/users/username/projects/replay/axios-src/test/node_modules/@types,/users/username/projects/replay/axios-src/node_modules/@types,/users/username/projects/replay/node_modules/@types,/users/username/projects/node_modules/@types,/users/username/node_modules/@types,/users/node_modules/@types,/node_modules/@types'. ======== Info seq [hh:mm:ss:mss] Resolving with primary search path '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types, /users/username/projects/replay/axios-src/test/module/node_modules/@types, /users/username/projects/replay/axios-src/test/node_modules/@types, /users/username/projects/replay/axios-src/node_modules/@types, /users/username/projects/replay/node_modules/@types, /users/username/projects/node_modules/@types, /users/username/node_modules/@types, /users/node_modules/@types, /node_modules/@types'. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] Resolving real path for '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/index.d.ts', result '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/index.d.ts'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/users/username/projects/replay/axios-src/test/module/ts-require'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/package.json 2000 undefined Project: /dev/null/inferredProject1* WatchType: File location affecting resolution @@ -412,21 +410,10 @@ Info seq [hh:mm:ss:mss] File '/users/username/projects/package.json' does not e Info seq [hh:mm:ss:mss] File '/users/username/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/users/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/users/username/projects/replay/axios-src/node_modules/@types/responselike/index.d.ts'. ======== -Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/users/username/projects/replay/axios-src/node_modules/@types/responselike'. -Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/test/module/ts-require/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/test/module/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/test/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/axios-src/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/replay/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/projects/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/username/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/users/username/projects/replay/axios-src/node_modules/@types/responselike/index.d.ts', root directory '/users/username/projects/replay/axios-src/test/module/ts/node_modules/@types,/users/username/projects/replay/axios-src/test/module/node_modules/@types,/users/username/projects/replay/axios-src/test/node_modules/@types,/users/username/projects/replay/axios-src/node_modules/@types,/users/username/projects/replay/node_modules/@types,/users/username/projects/node_modules/@types,/users/username/node_modules/@types,/users/node_modules/@types,/node_modules/@types'. ======== +Info seq [hh:mm:ss:mss] Resolving with primary search path '/users/username/projects/replay/axios-src/test/module/ts/node_modules/@types, /users/username/projects/replay/axios-src/test/module/node_modules/@types, /users/username/projects/replay/axios-src/test/node_modules/@types, /users/username/projects/replay/axios-src/node_modules/@types, /users/username/projects/replay/node_modules/@types, /users/username/projects/node_modules/@types, /users/username/node_modules/@types, /users/node_modules/@types, /node_modules/@types'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/users/username/projects/replay/axios-src/test/module/ts'. +Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/users/username/projects/replay/axios-src/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/replay/axios-src/test/module/ts/node_modules/@types/node/package.json 2000 undefined Project: /dev/null/inferredProject2* WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/replay/axios-src/test/module/ts/node_modules/@types/package.json 2000 undefined Project: /dev/null/inferredProject2* WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/replay/axios-src/test/module/ts/node_modules/package.json 2000 undefined Project: /dev/null/inferredProject2* WatchType: File location affecting resolution @@ -435,11 +422,10 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /users/username/p Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /users/username/projects/replay/axios-src/test/module/ts/node_modules/@types 1 undefined Project: /dev/null/inferredProject2* WatchType: Type roots Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject2* projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject2*' (Inferred) -Info seq [hh:mm:ss:mss] Files (5) +Info seq [hh:mm:ss:mss] Files (4) /home/src/tslibs/TS/Lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };" /users/username/projects/replay/axios-src/test/module/ts/index.js SVC-1-0 "export const y = 10;\n" /users/username/projects/replay/axios-src/test/module/ts/node_modules/@types/node/index.d.ts Text-1 "export const x = 10;\n" - /users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/index.d.ts Text-1 "export const x = 10;\n" /users/username/projects/replay/axios-src/node_modules/@types/responselike/index.d.ts Text-1 "/// \nexport const z = 10;\n" @@ -449,7 +435,6 @@ Info seq [hh:mm:ss:mss] Files (5) Root file specified for compilation node_modules/@types/node/index.d.ts Entry point for implicit type library 'node' - ../ts-require/node_modules/@types/node/index.d.ts Type library referenced via 'node' from file '../../../node_modules/@types/responselike/index.d.ts' ../../../node_modules/@types/responselike/index.d.ts Entry point for implicit type library 'responselike' @@ -460,7 +445,7 @@ Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject2*' (Inferred) -Info seq [hh:mm:ss:mss] Files (5) +Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -595,11 +580,10 @@ ScriptInfos:: version: SVC-1-1 containingProjects: 1 /dev/null/inferredProject1* *default* -/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/index.d.ts *changed* +/users/username/projects/replay/axios-src/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 *changed* + containingProjects: 1 /dev/null/inferredProject1* - /dev/null/inferredProject2* *new* /users/username/projects/replay/axios-src/test/module/ts/index.js (Open) *new* version: SVC-1-0 containingProjects: 1 diff --git a/tests/baselines/reference/tsserver/resolutionCache/project-with-imports.js b/tests/baselines/reference/tsserver/resolutionCache/project-with-imports.js index 89fd2d0538ff3..1c4c8846bd70e 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/project-with-imports.js +++ b/tests/baselines/reference/tsserver/resolutionCache/project-with-imports.js @@ -813,7 +813,8 @@ Info seq [hh:mm:ss:mss] Reusing resolution of type reference directive 'pkg2' f Info seq [hh:mm:ss:mss] Reusing resolution of type reference directive 'pkg3' from '/home/src/workspaces/project/fileWithTypeRefs.ts' of old program, it was not resolved. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/node_modules/pkg2/package.json' exists according to earlier cached lookups. Info seq [hh:mm:ss:mss] Reusing resolution of module 'pkg0' from '/home/src/workspaces/project/randomFileForImport.ts' of old program, it was successfully resolved to '/home/src/workspaces/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. -Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'pkg2', containing file '/home/src/workspaces/project/randomFileForTypeRef.ts'. ======== +Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'pkg2', containing file '/home/src/workspaces/project/randomFileForTypeRef.ts', root directory '/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. Info seq [hh:mm:ss:mss] Resolution for type reference directive 'pkg2' was found in cache from location '/home/src/workspaces/project'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'pkg2' was successfully resolved to '/home/src/workspaces/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ======== Info seq [hh:mm:ss:mss] Reusing resolution of type reference directive 'pkg4' from '/home/src/workspaces/project/__inferred type names__.ts' of old program, it was successfully resolved to '/home/src/workspaces/project/node_modules/@types/pkg4/index.d.ts'. diff --git a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-only-one-with-typeRoots.js b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-only-one-with-typeRoots.js index ae96ea774cbe7..46f151b30a5aa 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-only-one-with-typeRoots.js +++ b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-only-one-with-typeRoots.js @@ -317,9 +317,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspa Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution diff --git a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-common-@types-with-types.js b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-common-@types-with-types.js index f04c11dedba48..729959b26d5c9 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-common-@types-with-types.js +++ b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-common-@types-with-types.js @@ -378,10 +378,7 @@ Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspac Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'responselike', containing file '/home/src/workspaces/project/test/module/ts/__inferred type names__.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/node_modules/@types/responselike/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'responselike' was found in cache from location '/home/src/workspaces/project/test/module'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'responselike' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules 1 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules 1 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: Failed Lookup Locations @@ -393,8 +390,13 @@ Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. ======== -Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/node_modules/@types/responselike'. +Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-common-@types.js b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-common-@types.js index e874637c17f53..3b157dfa9ebeb 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-common-@types.js +++ b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-common-@types.js @@ -139,11 +139,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspa Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts-require/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts-require'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/node_modules/@types/node/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts-require/tsconfig.json WatchType: File location affecting resolution @@ -392,20 +388,14 @@ Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspac Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/test/module/ts/__inferred type names__.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules 1 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules 1 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'responselike', containing file '/home/src/workspaces/project/test/module/ts/__inferred type names__.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/ts/node_modules/@types' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] Directory '/home/src/workspaces/project/test/module/node_modules/@types' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/node_modules/@types/responselike/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'responselike' was found in cache from location '/home/src/workspaces/project/test/module'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'responselike' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/node_modules/@types/package.json' does not exist according to earlier cached lookups. @@ -424,8 +414,9 @@ Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. ======== -Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/node_modules/@types/responselike'. +Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types 1 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types 1 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: Type roots diff --git a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-typeRoots-unspecified-with-types.js b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-typeRoots-unspecified-with-types.js index 0386d461272d0..001eb98f8c3d4 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-typeRoots-unspecified-with-types.js +++ b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-typeRoots-unspecified-with-types.js @@ -402,13 +402,16 @@ Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. ======== -Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/node_modules/@types/responselike'. -Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts'. +Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/@types/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/package.json' does not exist according to earlier cached lookups. @@ -416,13 +419,19 @@ Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/test/module/ts/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/test/module/ts/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (5) /home/src/tslibs/TS/Lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };" /home/src/workspaces/project/test/module/ts/index.ts SVC-1-0 "export const tsIndex= 10;" /home/src/workspaces/project/test/module/ts/main.ts Text-1 "export const tsMain = 10;" - /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts Text-1 "declare const tsRequireGlobal = 10;" + /home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts Text-1 "declare const tsRequireGlobal = 10;" /home/src/workspaces/project/node_modules/@types/responselike/index.d.ts Text-1 "/// \nexport const z = 10;\n" @@ -432,7 +441,7 @@ Info seq [hh:mm:ss:mss] Files (5) Matched by default include pattern '**/*' main.ts Matched by default include pattern '**/*' - ../ts-require/node_modules/@types/node/index.d.ts + node_modules/@types/node/index.d.ts Type library referenced via 'node' from file '../../../node_modules/@types/responselike/index.d.ts' ../../../node_modules/@types/responselike/index.d.ts Entry point of type library 'responselike' specified in compilerOptions @@ -554,6 +563,14 @@ PolledWatches:: {"pollingInterval":2000} /home/src/workspaces/project/test/module/ts-require/package.json: {"pollingInterval":2000} +/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/test/module/ts/node_modules/@types/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/test/module/ts/node_modules/package.json: *new* + {"pollingInterval":2000} +/home/src/workspaces/project/test/module/ts/package.json: *new* + {"pollingInterval":2000} /home/src/workspaces/project/test/node_modules: {"pollingInterval":500} /home/src/workspaces/project/test/package.json: @@ -612,11 +629,10 @@ ScriptInfos:: version: Text-1 containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json -/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts *changed* +/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 *changed* + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json *new* /home/src/workspaces/project/test/module/ts/index.ts (Open) *new* version: SVC-1-0 containingProjects: 1 @@ -625,6 +641,10 @@ ScriptInfos:: version: Text-1 containingProjects: 1 /home/src/workspaces/project/test/module/ts/tsconfig.json +/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts *new* + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/test/module/ts/tsconfig.json build ts project with edit Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/workspaces/project/test/module/ts/main.ts 1:: WatchInfo: /home/src/workspaces/project/test/module/ts/main.ts 500 undefined WatchType: Closed Script info @@ -674,9 +694,8 @@ ScriptInfos:: /home/src/workspaces/project/test/module/ts-require/tsconfig.json /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json /home/src/workspaces/project/test/module/ts/index.ts (Open) version: SVC-1-0 containingProjects: 1 @@ -686,13 +705,17 @@ ScriptInfos:: pendingReloadFromDisk: true *changed* containingProjects: 1 /home/src/workspaces/project/test/module/ts/tsconfig.json +/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/test/module/ts/tsconfig.json Info seq [hh:mm:ss:mss] Running: /home/src/workspaces/project/test/module/ts/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/test/module/ts/tsconfig.json -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/@types/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/node_modules/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/package.json' does not exist according to earlier cached lookups. @@ -714,7 +737,7 @@ Info seq [hh:mm:ss:mss] Files (5) /home/src/tslibs/TS/Lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };" /home/src/workspaces/project/test/module/ts/index.ts SVC-1-0 "export const tsIndex= 10;" /home/src/workspaces/project/test/module/ts/main.ts Text-2 "export const tsMain = 10;export const z = 10;" - /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts Text-1 "declare const tsRequireGlobal = 10;" + /home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts Text-1 "declare const tsRequireGlobal = 10;" /home/src/workspaces/project/node_modules/@types/responselike/index.d.ts Text-1 "/// \nexport const z = 10;\n" Info seq [hh:mm:ss:mss] ----------------------------------------------- @@ -794,9 +817,8 @@ ScriptInfos:: /home/src/workspaces/project/test/module/ts-require/tsconfig.json /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json /home/src/workspaces/project/test/module/ts/index.ts (Open) version: SVC-1-0 containingProjects: 1 @@ -806,6 +828,10 @@ ScriptInfos:: pendingReloadFromDisk: false *changed* containingProjects: 1 /home/src/workspaces/project/test/module/ts/tsconfig.json +/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/test/module/ts/tsconfig.json Before running Timeout callback:: count: 0 @@ -864,9 +890,8 @@ ScriptInfos:: /home/src/workspaces/project/test/module/ts-require/tsconfig.json /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json /home/src/workspaces/project/test/module/ts/index.ts (Open) version: SVC-1-0 containingProjects: 1 @@ -875,6 +900,10 @@ ScriptInfos:: version: Text-2 containingProjects: 1 /home/src/workspaces/project/test/module/ts/tsconfig.json +/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/test/module/ts/tsconfig.json Info seq [hh:mm:ss:mss] Running: /home/src/workspaces/project/test/module/ts-require/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/test/module/ts-require/tsconfig.json @@ -984,9 +1013,8 @@ ScriptInfos:: /home/src/workspaces/project/test/module/ts-require/tsconfig.json /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json /home/src/workspaces/project/test/module/ts/index.ts (Open) version: SVC-1-0 containingProjects: 1 @@ -995,6 +1023,10 @@ ScriptInfos:: version: Text-2 containingProjects: 1 /home/src/workspaces/project/test/module/ts/tsconfig.json +/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts + version: Text-1 + containingProjects: 1 + /home/src/workspaces/project/test/module/ts/tsconfig.json Before running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-typeRoots-unspecified.js b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-typeRoots-unspecified.js index 6edb8adea5083..b67fbdb19da8a 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-typeRoots-unspecified.js +++ b/tests/baselines/reference/tsserver/resolutionCache/typeRef-resolutions-with-typeRoots-unspecified.js @@ -142,9 +142,7 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspa Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts-require/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts-require/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', result '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts-require'. Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/tslibs/TS/Lib/lib.d.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts-require/tsconfig.json WatchType: File location affecting resolution @@ -433,20 +431,10 @@ Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts'. ======== -Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/node_modules/@types/responselike'. -Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts', primary: true. ======== -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] ======== Resolving type reference directive 'node', containing file '/home/src/workspaces/project/node_modules/@types/responselike/index.d.ts', root directory '/home/src/workspaces/project/test/module/ts/node_modules/@types,/home/src/workspaces/project/test/module/node_modules/@types,/home/src/workspaces/project/test/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Info seq [hh:mm:ss:mss] Resolving with primary search path '/home/src/workspaces/project/test/module/ts/node_modules/@types, /home/src/workspaces/project/test/module/node_modules/@types, /home/src/workspaces/project/test/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Info seq [hh:mm:ss:mss] Resolution for type reference directive 'node' was found in cache from location '/home/src/workspaces/project/test/module/ts'. +Info seq [hh:mm:ss:mss] ======== Type reference directive 'node' was successfully resolved to '/home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts', primary: true. ======== Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types/node/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/package.json 2000 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: File location affecting resolution @@ -455,12 +443,11 @@ Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/workspa Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/workspaces/project/test/module/ts/node_modules/@types 1 undefined Project: /home/src/workspaces/project/test/module/ts/tsconfig.json WatchType: Type roots Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/test/module/ts/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/test/module/ts/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (5) /home/src/tslibs/TS/Lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };" /home/src/workspaces/project/test/module/ts/index.ts SVC-1-0 "export const tsIndex= 10;" /home/src/workspaces/project/test/module/ts/main.ts Text-1 "export const tsMain = 10;" /home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts Text-1 "declare const tsRequireGlobal = 10;" - /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts Text-1 "declare const tsRequireGlobal = 10;" /home/src/workspaces/project/node_modules/@types/responselike/index.d.ts Text-1 "/// \nexport const z = 10;\n" @@ -472,7 +459,6 @@ Info seq [hh:mm:ss:mss] Files (6) Matched by default include pattern '**/*' node_modules/@types/node/index.d.ts Entry point for implicit type library 'node' - ../ts-require/node_modules/@types/node/index.d.ts Type library referenced via 'node' from file '../../../node_modules/@types/responselike/index.d.ts' ../../../node_modules/@types/responselike/index.d.ts Entry point for implicit type library 'responselike' @@ -505,8 +491,8 @@ Info seq [hh:mm:ss:mss] event: "tsSize": 50, "tsx": 0, "tsxSize": 0, - "dts": 4, - "dtsSize": 535, + "dts": 3, + "dtsSize": 500, "deferred": 0, "deferredSize": 0 }, @@ -547,7 +533,7 @@ Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/test/module/ts/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -669,11 +655,10 @@ ScriptInfos:: version: Text-1 containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json -/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts *changed* +/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 *changed* + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json *new* /home/src/workspaces/project/test/module/ts/index.ts (Open) *new* version: SVC-1-0 containingProjects: 1 @@ -735,9 +720,8 @@ ScriptInfos:: /home/src/workspaces/project/test/module/ts-require/tsconfig.json /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json /home/src/workspaces/project/test/module/ts/index.ts (Open) version: SVC-1-0 containingProjects: 1 @@ -765,17 +749,6 @@ Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/@types/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/ts-require/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/module/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/test/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/node_modules/@types/responselike/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/node_modules/@types/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/node_modules/package.json' does not exist according to earlier cached lookups. @@ -786,12 +759,11 @@ Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to e Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/test/module/ts/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: false structureIsReused:: Completely Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/test/module/ts/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (5) /home/src/tslibs/TS/Lib/lib.d.ts Text-1 "/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };" /home/src/workspaces/project/test/module/ts/index.ts SVC-1-0 "export const tsIndex= 10;" /home/src/workspaces/project/test/module/ts/main.ts Text-2 "export const tsMain = 10;export const z = 10;" /home/src/workspaces/project/test/module/ts/node_modules/@types/node/index.d.ts Text-1 "declare const tsRequireGlobal = 10;" - /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts Text-1 "declare const tsRequireGlobal = 10;" /home/src/workspaces/project/node_modules/@types/responselike/index.d.ts Text-1 "/// \nexport const z = 10;\n" Info seq [hh:mm:ss:mss] ----------------------------------------------- @@ -802,7 +774,7 @@ Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/test/module/ts/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -816,7 +788,7 @@ Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/test/module/ts/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -871,9 +843,8 @@ ScriptInfos:: /home/src/workspaces/project/test/module/ts-require/tsconfig.json /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json /home/src/workspaces/project/test/module/ts/index.ts (Open) version: SVC-1-0 containingProjects: 1 @@ -945,9 +916,8 @@ ScriptInfos:: /home/src/workspaces/project/test/module/ts-require/tsconfig.json /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json /home/src/workspaces/project/test/module/ts/index.ts (Open) version: SVC-1-0 containingProjects: 1 @@ -999,7 +969,7 @@ Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/test/module/ts/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -1013,7 +983,7 @@ Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/test/module/ts/tsconfig.json' (Configured) -Info seq [hh:mm:ss:mss] Files (6) +Info seq [hh:mm:ss:mss] Files (5) Info seq [hh:mm:ss:mss] ----------------------------------------------- Info seq [hh:mm:ss:mss] Open files: @@ -1069,9 +1039,8 @@ ScriptInfos:: /home/src/workspaces/project/test/module/ts-require/tsconfig.json /home/src/workspaces/project/test/module/ts-require/node_modules/@types/node/index.d.ts version: Text-1 - containingProjects: 2 + containingProjects: 1 /home/src/workspaces/project/test/module/ts-require/tsconfig.json - /home/src/workspaces/project/test/module/ts/tsconfig.json /home/src/workspaces/project/test/module/ts/index.ts (Open) version: SVC-1-0 containingProjects: 1