From 4935835e3abef6a73a08a9cf20ab4aa6cb5cdb68 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 29 Sep 2023 11:22:44 -0700 Subject: [PATCH] Make sure reused resolutions from file are accounted if all resolutions are reused/are resolved to ambient module names --- src/compiler/program.ts | 61 +++++++++++-- src/compiler/resolutionCache.ts | 90 ++++++++++++++++++- src/compiler/types.ts | 19 ++++ src/compiler/watchPublic.ts | 2 + src/server/project.ts | 48 +++++++++- src/services/services.ts | 2 + src/services/types.ts | 5 ++ ...-no-notification-from-fs-for-index-file.js | 47 +++++----- ...-orphan,-and-orphan-script-info-changes.js | 22 +++++ ...he-source-file-if-script-info-is-orphan.js | 22 +++++ ...n-script-info-with-different-scriptKind.js | 24 +++++ ...-to-date-with-the-reference-map-changes.js | 52 +++-------- ...-to-date-with-the-reference-map-changes.js | 52 +++-------- ...-to-date-with-the-reference-map-changes.js | 52 +++-------- .../importSuggestionsCache_coreNodeModules.js | 52 +++++++++++ 15 files changed, 394 insertions(+), 156 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index d2010a30aa1..1e52fe1faba 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1083,7 +1083,8 @@ function getTypeReferenceResolutionName(entry: return !isString(entry) ? entry.fileName : entry; } -const typeReferenceResolutionNameAndModeGetter: ResolutionNameAndModeGetter = { +/** @internal */ +export const typeReferenceResolutionNameAndModeGetter: ResolutionNameAndModeGetter = { getName: getTypeReferenceResolutionName, getMode: (entry, file, compilerOptions) => getModeForFileReference(entry, file && getDefaultResolutionModeForFileWorker(file, compilerOptions)), }; @@ -1902,6 +1903,9 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } tracing?.pop(); } + else { + host.onReusedTypeReferenceDirectiveResolutions?.(/*reusedNames*/ undefined, /*containingSourceFile*/ undefined, /*redirectedReference*/ undefined, options); + } // Do not process the default library if: // - The '--noLib' flag is used. @@ -2334,6 +2338,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg redirectedReference: getRedirectReferenceForResolution(containingFile), nameAndModeGetter: moduleResolutionNameAndModeGetter, resolutionWorker: resolveModuleNamesWorker, + onReusedResolutions: maybeBind(host, host.onReusedModuleResolutions), getResolutionFromOldProgram: (name, mode) => oldProgram?.getResolvedModule(containingFile, name, mode), getResolved: getResolvedModuleFromResolution, canReuseResolutionsInFile: () => @@ -2354,6 +2359,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg redirectedReference: containingSourceFile && getRedirectReferenceForResolution(containingSourceFile), nameAndModeGetter: typeReferenceResolutionNameAndModeGetter, resolutionWorker: resolveTypeReferenceDirectiveNamesWorker, + onReusedResolutions: maybeBind(host, host.onReusedTypeReferenceDirectiveResolutions), getResolutionFromOldProgram: (name, mode) => containingSourceFile ? oldProgram?.getResolvedTypeReferenceDirective(containingSourceFile, name, mode) : @@ -2377,6 +2383,14 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg containingFile: SourceFileOrString, reusedNames: readonly Entry[] | undefined, ) => readonly Resolution[]; + onReusedResolutions: + | (( + resuedEntries: readonly Entry[] | undefined, + containingSourceFile: SourceFileOrUndefined, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + ) => void) + | undefined; getResolutionFromOldProgram: (name: string, mode: ResolutionMode) => Resolution | undefined; getResolved: (oldResolution: Resolution) => ResolutionWithResolvedFileName | undefined; canReuseResolutionsInFile: () => boolean; @@ -2390,12 +2404,21 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg redirectedReference, nameAndModeGetter, resolutionWorker, + onReusedResolutions, getResolutionFromOldProgram, getResolved, canReuseResolutionsInFile, resolveToOwnAmbientModule, }: ResolveNamesReusingOldStateInput): readonly Resolution[] { - if (!entries.length) return emptyArray; + if (!entries.length) { + onReusedResolutions?.( + entries, + containingSourceFile, + redirectedReference, + options, + ); + return emptyArray; + } if (structureIsReused === StructureIsReused.Not && (!resolveToOwnAmbientModule || !containingSourceFile!.ambientModuleNames.length)) { // 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. @@ -2464,8 +2487,20 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg (unknownEntryIndices ??= []).push(i); } - if (!unknownEntries) return result!; - const resolutions = resolutionWorker(unknownEntries, containingFile, reusedNames); + if (!unknownEntries) { + onReusedResolutions?.( + reusedNames, + containingSourceFile, + redirectedReference, + options, + ); + return result!; + } + const resolutions = resolutionWorker( + unknownEntries, + containingFile, + reusedNames, + ); if (!result) return resolutions; resolutions.forEach((resolution, index) => result[unknownEntryIndices![index]] = resolution); return result; @@ -4051,7 +4086,15 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg function processTypeReferenceDirectives(file: SourceFile) { const typeDirectives = file.typeReferenceDirectives; - if (!typeDirectives.length) return; + if (!typeDirectives.length) { + host.onReusedTypeReferenceDirectiveResolutions?.( + /*reusedNames*/ undefined, + file, + getRedirectReferenceForResolution(file), + options, + ); + return; + } const resolutions = resolvedTypeReferenceDirectiveNamesProcessing?.get(file.path) || resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file); @@ -4244,6 +4287,14 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } } } + else { + host.onReusedModuleResolutions?.( + /*reusedNames*/ undefined, + file, + getRedirectReferenceForResolution(file), + options, + ); + } } function checkSourceFilesBelongToPath(sourceFiles: readonly SourceFile[], rootDirectory: string): boolean { diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index fc6cb0d6f32..338d5e94dc9 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -3,6 +3,7 @@ import { clearMap, closeFileWatcher, closeFileWatcherOf, + CompilerHostSupportingResolutionCache, CompilerOptions, createModeAwareCache, createModuleResolutionCache, @@ -20,6 +21,7 @@ import { FileWatcher, FileWatcherCallback, firstDefinedIterator, + getAutomaticTypeDirectiveContainingFile, GetCanonicalFileName, getDirectoryPath, getEffectiveTypeRoots, @@ -60,6 +62,7 @@ import { resolutionExtensionIsTSOrJson, ResolutionLoader, ResolutionMode, + ResolutionNameAndModeGetter, ResolutionWithResolvedFileName, ResolvedModuleWithFailedLookupLocations, ResolvedProjectReference, @@ -72,6 +75,7 @@ import { startsWith, StringLiteralLike, trace, + typeReferenceResolutionNameAndModeGetter, updateResolutionField, WatchDirectoryFlags, } from "./_namespaces/ts.js"; @@ -94,7 +98,7 @@ export type CallbackOnNewResolution { rootDirForResolution: string; resolvedModuleNames: Map>; resolvedTypeReferenceDirectives: Map>; @@ -688,6 +692,8 @@ export function createResolutionCache( finishCachingPerDirectoryResolution, resolveModuleNameLiterals, resolveTypeReferenceDirectiveReferences, + onReusedModuleResolutions, + onReusedTypeReferenceDirectiveResolutions, resolveLibrary, resolveSingleModuleNameWithoutWatching, removeResolutionsFromProjectReferenceRedirects, @@ -960,10 +966,48 @@ export function createResolutionCache( seenNamesInFile.set(name, mode, true); resolvedModules.push(resolution); } + onReusedResolutions({ + reusedNames, + containingSourceFile, + redirectedReference, + options, + path, + resolutionsInFile, + seenNamesInFile, + nameAndModeGetter: loader.nameAndMode, + getResolutionWithResolvedFileName, + }); + return resolvedModules; + } + + interface OnReusedResolutionsInput { + reusedNames: readonly Entry[] | undefined; + containingSourceFile: SourceFile; + redirectedReference: ResolvedProjectReference | undefined; + options: CompilerOptions; + path: Path; + resolutionsInFile: ModeAwareCache | undefined; + seenNamesInFile?: ModeAwareCache; + nameAndModeGetter: ResolutionNameAndModeGetter; + getResolutionWithResolvedFileName: GetResolutionWithResolvedFileName; + } + function onReusedResolutions({ + reusedNames, + containingSourceFile, + redirectedReference, + options, + path, + resolutionsInFile, + seenNamesInFile, + nameAndModeGetter, + getResolutionWithResolvedFileName, + }: OnReusedResolutionsInput) { + if (!resolutionsInFile) return; + if (!seenNamesInFile) seenNamesInFile = createModeAwareCache(); reusedNames?.forEach(entry => seenNamesInFile.set( - loader.nameAndMode.getName(entry), - loader.nameAndMode.getMode(entry, containingSourceFile, redirectedReference?.commandLine.options || options), + nameAndModeGetter.getName(entry), + nameAndModeGetter.getMode(entry, containingSourceFile, redirectedReference?.commandLine.options || options), true, ) ); @@ -976,7 +1020,45 @@ export function createResolutionCache( } }); } - return resolvedModules; + } + + function onReusedModuleResolutions( + reusedNames: readonly StringLiteralLike[] | undefined, + containingSourceFile: SourceFile, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + ) { + onReusedResolutions({ + reusedNames, + containingSourceFile, + redirectedReference, + options, + path: containingSourceFile.path, + resolutionsInFile: resolvedModuleNames.get(containingSourceFile.path), + nameAndModeGetter: moduleResolutionNameAndModeGetter, + getResolutionWithResolvedFileName: getResolvedModuleFromResolution, + }); + } + + function onReusedTypeReferenceDirectiveResolutions( + reusedNames: readonly T[] | undefined, + containingSourceFile: SourceFile | undefined, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + ) { + const path = containingSourceFile ? + containingSourceFile.path : + resolutionHost.toPath(getAutomaticTypeDirectiveContainingFile(resolutionHost.getCompilationSettings(), getCurrentDirectory())); + onReusedResolutions({ + reusedNames, + containingSourceFile, + redirectedReference, + options, + path, + resolutionsInFile: resolvedTypeReferenceDirectives.get(path), + nameAndModeGetter: typeReferenceResolutionNameAndModeGetter, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirectiveFromResolution, + }); } function resolveTypeReferenceDirectiveReferences( diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 171898bcee7..be1f8c2f128 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -8113,6 +8113,25 @@ export interface CompilerHost extends ModuleResolutionHost { jsDocParsingMode?: JSDocParsingMode; } +/** @internal */ +export interface CompilerHostSupportingResolutionCache { + onReusedModuleResolutions?( + reusedNames: readonly StringLiteralLike[] | undefined, + containingSourceFile: SourceFile, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + ): void; + onReusedTypeReferenceDirectiveResolutions?( + reusedNames: readonly T[] | undefined, + containingSourceFile: SourceFile | undefined, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + ): void; +} +/** @internal */ +export interface CompilerHost extends CompilerHostSupportingResolutionCache { +} + /** true if --out otherwise source file name * * @internal */ diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index 69e864af971..4967b56e87a 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -529,11 +529,13 @@ export function createWatchProgram(host: WatchCompiler compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames); if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) { compilerHost.resolveModuleNameLiterals = resolutionCache.resolveModuleNameLiterals.bind(resolutionCache); + compilerHost.onReusedModuleResolutions = resolutionCache.onReusedModuleResolutions.bind(resolutionCache); } compilerHost.resolveTypeReferenceDirectiveReferences = maybeBind(host, host.resolveTypeReferenceDirectiveReferences); compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives); if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) { compilerHost.resolveTypeReferenceDirectiveReferences = resolutionCache.resolveTypeReferenceDirectiveReferences.bind(resolutionCache); + compilerHost.onReusedTypeReferenceDirectiveResolutions = resolutionCache.onReusedTypeReferenceDirectiveResolutions.bind(resolutionCache); } compilerHost.resolveLibrary = !host.resolveLibrary ? resolutionCache.resolveLibrary.bind(resolutionCache) : diff --git a/src/server/project.ts b/src/server/project.ts index 17076a920fa..f51c20eb12a 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -798,7 +798,14 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo } /** @internal */ - resolveModuleNameLiterals(moduleLiterals: readonly StringLiteralLike[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile, reusedNames: readonly StringLiteralLike[] | undefined): readonly ResolvedModuleWithFailedLookupLocations[] { + resolveModuleNameLiterals( + moduleLiterals: readonly StringLiteralLike[], + containingFile: string, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + containingSourceFile: SourceFile, + reusedNames: readonly StringLiteralLike[] | undefined, + ): readonly ResolvedModuleWithFailedLookupLocations[] { let invalidated = false; return this.resolutionCache.resolveModuleNameLiterals( moduleLiterals, @@ -818,13 +825,35 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo ); } + /** @internal */ + onReusedModuleResolutions( + reusedNames: readonly ts.StringLiteralLike[] | undefined, + containingSourceFile: ts.SourceFile, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + ): void { + return this.resolutionCache.onReusedModuleResolutions( + reusedNames, + containingSourceFile, + redirectedReference, + options, + ); + } + /** @internal */ getModuleResolutionCache(): ModuleResolutionCache | undefined { return this.resolutionCache.getModuleResolutionCache(); } /** @internal */ - resolveTypeReferenceDirectiveReferences(typeDirectiveReferences: readonly T[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile: SourceFile | undefined, reusedNames: readonly T[] | undefined): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] { + resolveTypeReferenceDirectiveReferences( + typeDirectiveReferences: readonly T[], + containingFile: string, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + containingSourceFile: SourceFile | undefined, + reusedNames: readonly T[] | undefined, + ): readonly ResolvedTypeReferenceDirectiveWithFailedLookupLocations[] { return this.resolutionCache.resolveTypeReferenceDirectiveReferences( typeDirectiveReferences, containingFile, @@ -835,6 +864,21 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo ); } + /** @internal */ + onReusedTypeReferenceDirectiveResolutions( + reusedNames: readonly T[] | undefined, + containingSourceFile: ts.SourceFile | undefined, + redirectedReference: ResolvedProjectReference | undefined, + options: CompilerOptions, + ): void { + return this.resolutionCache.onReusedTypeReferenceDirectiveResolutions( + reusedNames, + containingSourceFile, + redirectedReference, + options, + ); + } + /** @internal */ resolveLibrary(libraryName: string, resolveFrom: string, options: CompilerOptions, libFileName: string): ResolvedModuleWithFailedLookupLocations { return this.resolutionCache.resolveLibrary(libraryName, resolveFrom, options, libFileName); diff --git a/src/services/services.ts b/src/services/services.ts index c51089dfe25..529629908dc 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1759,6 +1759,8 @@ export function createLanguageService( resolveTypeReferenceDirectives: maybeBind(host, host.resolveTypeReferenceDirectives), resolveModuleNameLiterals: maybeBind(host, host.resolveModuleNameLiterals), resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences), + onReusedModuleResolutions: maybeBind(host, host.onReusedModuleResolutions), + onReusedTypeReferenceDirectiveResolutions: maybeBind(host, host.onReusedTypeReferenceDirectiveResolutions), resolveLibrary: maybeBind(host, host.resolveLibrary), useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect), getParsedCommandLine, diff --git a/src/services/types.ts b/src/services/types.ts index 30e4ee715d2..e9e8e032536 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -1,6 +1,7 @@ import { CancellationToken, CompilerHost, + CompilerHostSupportingResolutionCache, CompilerOptions, CustomTransformers, Diagnostic, @@ -436,6 +437,10 @@ export interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalR jsDocParsingMode?: JSDocParsingMode | undefined; } +/** @internal */ +export interface LanguageServiceHost extends CompilerHostSupportingResolutionCache { +} + /** @internal */ export const emptyOptions = {}; diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-installing-something-in-node_modules-or-@types-when-there-is-no-notification-from-fs-for-index-file.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-installing-something-in-node_modules-or-@types-when-there-is-no-notification-from-fs-for-index-file.js index ff1167e3841..41178064d11 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-installing-something-in-node_modules-or-@types-when-there-is-no-notification-from-fs-for-index-file.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-installing-something-in-node_modules-or-@types-when-there-is-no-notification-from-fs-for-index-file.js @@ -269,6 +269,8 @@ FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules/ FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules/@types/node/ts3.6/base.d.ts 250 undefined Source file FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules/@types/node/base.d.ts 250 undefined Source file FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules/@types/node/index.d.ts 250 undefined Source file +DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules/@types/node/package.json 2000 undefined File location affecting resolution FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules/@types/package.json 2000 undefined File location affecting resolution FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules/package.json 2000 undefined File location affecting resolution @@ -325,11 +327,13 @@ FsWatches *deleted*:: FsWatchesRecursive:: /user/username/projects/myproject: {} -/user/username/projects/myproject/node_modules: - {} /user/username/projects/myproject/node_modules/@types: {} +FsWatchesRecursive *deleted*:: +/user/username/projects/myproject/node_modules: + {} + Program root files: [ "/user/username/projects/myproject/worker.ts" @@ -365,9 +369,6 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules Scheduling update Scheduling invalidateFailedLookup Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types :: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Type roots -DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations -Scheduling invalidateFailedLookup, Cancelled earlier one -Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types :: WatchInfo: /user/username/projects/myproject 1 undefined Wild card directory Scheduling update Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types :: WatchInfo: /user/username/projects/myproject 1 undefined Wild card directory @@ -375,9 +376,6 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules Scheduling update Scheduling invalidateFailedLookup, Cancelled earlier one Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha :: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Type roots -DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations -Scheduling invalidateFailedLookup, Cancelled earlier one -Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha :: WatchInfo: /user/username/projects/myproject 1 undefined Wild card directory Scheduling update Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha :: WatchInfo: /user/username/projects/myproject 1 undefined Wild card directory @@ -385,21 +383,18 @@ DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules Scheduling update Scheduling invalidateFailedLookup, Cancelled earlier one Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Type roots -DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations -Scheduling invalidateFailedLookup, Cancelled earlier one -Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha/index.d.ts :: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha/index.d.ts :: WatchInfo: /user/username/projects/myproject 1 undefined Wild card directory Scheduling update Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myproject/node_modules/@types/mocha/index.d.ts :: WatchInfo: /user/username/projects/myproject 1 undefined Wild card directory Timeout callback:: count: 2 -42: timerToInvalidateFailedLookupResolutions *new* -43: timerToUpdateProgram *new* +39: timerToInvalidateFailedLookupResolutions *new* +40: timerToUpdateProgram *new* Before running Timeout callback:: count: 2 -42: timerToInvalidateFailedLookupResolutions -43: timerToUpdateProgram +39: timerToInvalidateFailedLookupResolutions +40: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -411,6 +406,8 @@ Synchronizing program CreatingProgramWith:: roots: ["/user/username/projects/myproject/worker.ts"] options: {"watch":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined Failed Lookup Locations FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types/mocha/index.d.ts 250 undefined Source file FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types/mocha/package.json 2000 undefined File location affecting resolution FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types/package.json 2000 undefined File location affecting resolution @@ -454,7 +451,7 @@ FsWatches:: FsWatchesRecursive:: /user/username/projects/myproject: {} -/user/username/projects/myproject/node_modules: +/user/username/projects/myproject/node_modules: *new* {} /user/username/projects/myproject/node_modules/@types: {} @@ -500,12 +497,12 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myprojec Timeout callback:: count: 2 -46: timerToInvalidateFailedLookupResolutions *new* -47: timerToUpdateProgram *new* +43: timerToInvalidateFailedLookupResolutions *new* +44: timerToUpdateProgram *new* Before running Timeout callback:: count: 2 -46: timerToInvalidateFailedLookupResolutions -47: timerToUpdateProgram +43: timerToInvalidateFailedLookupResolutions +44: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -629,12 +626,12 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myprojec Timeout callback:: count: 2 -52: timerToUpdateProgram *new* -54: timerToInvalidateFailedLookupResolutions *new* +49: timerToUpdateProgram *new* +51: timerToInvalidateFailedLookupResolutions *new* Before running Timeout callback:: count: 2 -52: timerToUpdateProgram -54: timerToInvalidateFailedLookupResolutions +49: timerToUpdateProgram +51: timerToInvalidateFailedLookupResolutions After running Timeout callback:: count: 0 Output:: @@ -708,7 +705,7 @@ FsWatchesRecursive:: {} Timeout callback:: count: 0 -54: timerToInvalidateFailedLookupResolutions *deleted* +51: timerToInvalidateFailedLookupResolutions *deleted* Before running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan,-and-orphan-script-info-changes.js b/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan,-and-orphan-script-info-changes.js index ce7447d6ff4..6431284fdac 100644 --- a/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan,-and-orphan-script-info-changes.js +++ b/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan,-and-orphan-script-info-changes.js @@ -257,6 +257,8 @@ ScriptInfos:: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject 0 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject 0 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (2) @@ -282,6 +284,24 @@ export const a: number; export const b: number; +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {} +/user/username/projects/myproject/module1.d.ts: + {} +/user/username/projects/myproject/tsconfig.json: + {} + +FsWatches *deleted*:: +/user/username/projects/myproject: + {} + Projects:: /user/username/projects/myproject/tsconfig.json (Configured) *changed* projectStateVersion: 2 @@ -349,6 +369,8 @@ ScriptInfos:: containingProjects: 0 Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 0 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 0 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 3 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (3) diff --git a/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan.js b/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan.js index 00af621318d..4e203a39327 100644 --- a/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan.js +++ b/tests/baselines/reference/tsserver/documentRegistry/Caches-the-source-file-if-script-info-is-orphan.js @@ -257,6 +257,8 @@ ScriptInfos:: /user/username/projects/myproject/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject 0 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject 0 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (2) @@ -276,6 +278,24 @@ DocumentRegistry:: /home/src/tslibs/ts/lib/lib.d.ts: TS 1 Before request +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: + {"pollingInterval":500} +/user/username/projects/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {} +/user/username/projects/myproject/module1.d.ts: + {} +/user/username/projects/myproject/tsconfig.json: + {} + +FsWatches *deleted*:: +/user/username/projects/myproject: + {} + Projects:: /user/username/projects/myproject/tsconfig.json (Configured) *changed* projectStateVersion: 2 @@ -341,6 +361,8 @@ ScriptInfos:: containingProjects: 0 Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 0 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 0 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json projectStateVersion: 3 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (3) diff --git a/tests/baselines/reference/tsserver/documentRegistry/works-when-reusing-orphan-script-info-with-different-scriptKind.js b/tests/baselines/reference/tsserver/documentRegistry/works-when-reusing-orphan-script-info-with-different-scriptKind.js index 215648946d3..a9218ec82ca 100644 --- a/tests/baselines/reference/tsserver/documentRegistry/works-when-reusing-orphan-script-info-with-different-scriptKind.js +++ b/tests/baselines/reference/tsserver/documentRegistry/works-when-reusing-orphan-script-info-with-different-scriptKind.js @@ -271,6 +271,12 @@ Info seq [hh:mm:ss:mss] request: } Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: ^/inmemory/model/4 ProjectRootPath: /users/user/projects/san:: Result: undefined Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1* +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/user/projects/san/^ 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/user/projects/san/^ 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/user/projects/san/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/user/projects/san/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/user/projects/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/user/projects/node_modules 1 undefined Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* projectStateVersion: 3 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/dev/null/inferredProject1*' (Inferred) Info seq [hh:mm:ss:mss] Files (3) @@ -306,6 +312,24 @@ Info seq [hh:mm:ss:mss] response: } After request +PolledWatches:: +/users/user/projects/node_modules/@types: + {"pollingInterval":500} +/users/user/projects/san/node_modules/@types: + {"pollingInterval":500} + +PolledWatches *deleted*:: +/users/user/projects/node_modules: + {"pollingInterval":500} +/users/user/projects/san/^: + {"pollingInterval":500} +/users/user/projects/san/node_modules: + {"pollingInterval":500} + +FsWatches:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {} + Projects:: /dev/null/inferredProject1* (Inferred) *changed* projectStateVersion: 3 diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-the-reference-map-changes.js index d9e86e8b561..e4bd8527dc9 100644 --- a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-the-reference-map-changes.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/when-event-handler-is-set-in-the-session-and-should-be-up-to-date-with-the-reference-map-changes.js @@ -308,6 +308,10 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projec Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/moduleFile1.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/moduleFile2.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /users/username/projects/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /users/username/projects/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/users/username/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -367,16 +371,16 @@ After running Timeout callback:: count: 0 PolledWatches:: /users/username/projects/node_modules/@types: {"pollingInterval":500} -/users/username/projects/project/moduleFile1: - {"pollingInterval":500} /users/username/projects/project/node_modules/@types: {"pollingInterval":500} +PolledWatches *deleted*:: +/users/username/projects/project/moduleFile1: + {"pollingInterval":500} + FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {} -/users/username/projects/project: - {} /users/username/projects/project/file1Consumer2.ts: *new* {} /users/username/projects/project/globalFile3.ts: *new* @@ -388,6 +392,10 @@ FsWatches:: /users/username/projects/project/tsconfig.json: {} +FsWatches *deleted*:: +/users/username/projects/project: + {} + FsWatchesRecursive:: /users/username/projects/project: {} @@ -655,10 +663,6 @@ ScriptInfos:: Info seq [hh:mm:ss:mss] Running: /users/username/projects/project/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /users/username/projects/project/tsconfig.json -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /users/username/projects/project/tsconfig.json projectStateVersion: 4 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/users/username/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -700,38 +704,6 @@ Info seq [hh:mm:ss:mss] event: } After running Timeout callback:: count: 0 -PolledWatches:: -/users/username/projects/node_modules/@types: - {"pollingInterval":500} -/users/username/projects/project/node_modules/@types: - {"pollingInterval":500} - -PolledWatches *deleted*:: -/users/username/projects/project/moduleFile1: - {"pollingInterval":500} - -FsWatches:: -/home/src/tslibs/TS/Lib/lib.d.ts: - {} -/users/username/projects/project/file1Consumer2.ts: - {} -/users/username/projects/project/globalFile3.ts: - {} -/users/username/projects/project/moduleFile1.ts: - {} -/users/username/projects/project/moduleFile2.ts: - {} -/users/username/projects/project/tsconfig.json: - {} - -FsWatches *deleted*:: -/users/username/projects/project: - {} - -FsWatchesRecursive:: -/users/username/projects/project: - {} - Projects:: /users/username/projects/project/tsconfig.json (Configured) *changed* projectStateVersion: 4 diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js index 81521f8080c..95e3fe1b101 100644 --- a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/with-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js @@ -311,6 +311,10 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projec Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/moduleFile1.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/moduleFile2.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /users/username/projects/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /users/username/projects/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/users/username/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -371,16 +375,16 @@ After running Timeout callback:: count: 0 PolledWatches:: /users/username/projects/node_modules/@types: {"pollingInterval":500} -/users/username/projects/project/moduleFile1: - {"pollingInterval":500} /users/username/projects/project/node_modules/@types: {"pollingInterval":500} +PolledWatches *deleted*:: +/users/username/projects/project/moduleFile1: + {"pollingInterval":500} + FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {} -/users/username/projects/project: - {} /users/username/projects/project/file1Consumer2.ts: *new* {} /users/username/projects/project/globalFile3.ts: *new* @@ -392,6 +396,10 @@ FsWatches:: /users/username/projects/project/tsconfig.json: {} +FsWatches *deleted*:: +/users/username/projects/project: + {} + FsWatchesRecursive:: /users/username/projects/project: {} @@ -660,10 +668,6 @@ ScriptInfos:: Info seq [hh:mm:ss:mss] Running: /users/username/projects/project/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /users/username/projects/project/tsconfig.json -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /users/username/projects/project/tsconfig.json projectStateVersion: 4 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/users/username/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -706,38 +710,6 @@ Info seq [hh:mm:ss:mss] event: } After running Timeout callback:: count: 0 -PolledWatches:: -/users/username/projects/node_modules/@types: - {"pollingInterval":500} -/users/username/projects/project/node_modules/@types: - {"pollingInterval":500} - -PolledWatches *deleted*:: -/users/username/projects/project/moduleFile1: - {"pollingInterval":500} - -FsWatches:: -/home/src/tslibs/TS/Lib/lib.d.ts: - {} -/users/username/projects/project/file1Consumer2.ts: - {} -/users/username/projects/project/globalFile3.ts: - {} -/users/username/projects/project/moduleFile1.ts: - {} -/users/username/projects/project/moduleFile2.ts: - {} -/users/username/projects/project/tsconfig.json: - {} - -FsWatches *deleted*:: -/users/username/projects/project: - {} - -FsWatchesRecursive:: -/users/username/projects/project: - {} - Projects:: /users/username/projects/project/tsconfig.json (Configured) *changed* projectStateVersion: 4 diff --git a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js index 9679452640e..02d40815795 100644 --- a/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js +++ b/tests/baselines/reference/tsserver/events/projectUpdatedInBackground/without-noGetErrOnBackgroundUpdate-and-should-be-up-to-date-with-the-reference-map-changes.js @@ -311,6 +311,10 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projec Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/moduleFile1.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/moduleFile2.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /users/username/projects/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /users/username/projects/project/tsconfig.json projectStateVersion: 2 projectProgramVersion: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/users/username/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -372,16 +376,16 @@ After running Timeout callback:: count: 1 PolledWatches:: /users/username/projects/node_modules/@types: {"pollingInterval":500} -/users/username/projects/project/moduleFile1: - {"pollingInterval":500} /users/username/projects/project/node_modules/@types: {"pollingInterval":500} +PolledWatches *deleted*:: +/users/username/projects/project/moduleFile1: + {"pollingInterval":500} + FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {} -/users/username/projects/project: - {} /users/username/projects/project/file1Consumer2.ts: *new* {} /users/username/projects/project/globalFile3.ts: *new* @@ -393,6 +397,10 @@ FsWatches:: /users/username/projects/project/tsconfig.json: {} +FsWatches *deleted*:: +/users/username/projects/project: + {} + FsWatchesRecursive:: /users/username/projects/project: {} @@ -683,10 +691,6 @@ ScriptInfos:: Info seq [hh:mm:ss:mss] Running: /users/username/projects/project/tsconfig.json Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /users/username/projects/project/tsconfig.json -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project/moduleFile1 1 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations -Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /users/username/projects/project 0 undefined Project: /users/username/projects/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /users/username/projects/project/tsconfig.json projectStateVersion: 4 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/users/username/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) @@ -730,38 +734,6 @@ Info seq [hh:mm:ss:mss] event: } After running Timeout callback:: count: 1 -PolledWatches:: -/users/username/projects/node_modules/@types: - {"pollingInterval":500} -/users/username/projects/project/node_modules/@types: - {"pollingInterval":500} - -PolledWatches *deleted*:: -/users/username/projects/project/moduleFile1: - {"pollingInterval":500} - -FsWatches:: -/home/src/tslibs/TS/Lib/lib.d.ts: - {} -/users/username/projects/project/file1Consumer2.ts: - {} -/users/username/projects/project/globalFile3.ts: - {} -/users/username/projects/project/moduleFile1.ts: - {} -/users/username/projects/project/moduleFile2.ts: - {} -/users/username/projects/project/tsconfig.json: - {} - -FsWatches *deleted*:: -/users/username/projects/project: - {} - -FsWatchesRecursive:: -/users/username/projects/project: - {} - Timeout callback:: count: 1 21: checkOne *new* diff --git a/tests/baselines/reference/tsserver/fourslashServer/importSuggestionsCache_coreNodeModules.js b/tests/baselines/reference/tsserver/fourslashServer/importSuggestionsCache_coreNodeModules.js index 97bfe18310f..94b0f660c3f 100644 --- a/tests/baselines/reference/tsserver/fourslashServer/importSuggestionsCache_coreNodeModules.js +++ b/tests/baselines/reference/tsserver/fourslashServer/importSuggestionsCache_coreNodeModules.js @@ -4365,6 +4365,10 @@ Info seq [hh:mm:ss:mss] request: "command": "completionInfo" } Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /home/src/workspaces 0 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /home/src/workspaces 0 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /home/src/workspaces/project 0 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations +Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /home/src/workspaces/project 0 undefined Project: /home/src/workspaces/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/workspaces/project/tsconfig.json projectStateVersion: 3 projectProgramVersion: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/workspaces/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (5) @@ -4948,6 +4952,54 @@ Info seq [hh:mm:ss:mss] response: } } After Request +watchedFiles:: +/home/src/tslibs/TS/Lib/lib.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.d.ts: + {"pollingInterval":500} +/home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/jsconfig.json: + {"pollingInterval":2000} +/home/src/workspaces/project/node_modules/@types/node/index.d.ts: + {"pollingInterval":500} +/home/src/workspaces/project/node_modules/@types/node/package.json: + {"pollingInterval":2000} + {"pollingInterval":2000} +/home/src/workspaces/project/node_modules/@types/package.json: + {"pollingInterval":2000} + {"pollingInterval":2000} +/home/src/workspaces/project/node_modules/package.json: + {"pollingInterval":2000} + {"pollingInterval":2000} +/home/src/workspaces/project/package.json: + {"pollingInterval":2000} + {"pollingInterval":2000} + {"pollingInterval":250} +/home/src/workspaces/project/tsconfig.json: + {"pollingInterval":2000} + +watchedDirectories *deleted*:: +/home/src/workspaces: + {} +/home/src/workspaces/project: + {} + +watchedDirectoriesRecursive:: +/home/src/workspaces/node_modules: + {} + {} +/home/src/workspaces/node_modules/@types: + {} +/home/src/workspaces/project: + {} +/home/src/workspaces/project/node_modules: + {} + {} +/home/src/workspaces/project/node_modules/@types: + {} + {} + Projects:: /dev/null/inferredProject1* (Inferred) projectStateVersion: 1