diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index e331133fe7..6d7c1f6c0e 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -240,35 +240,11 @@ namespace ts { } function updateFailedLookupLocationWatches(containingFile: string, name: string, existingFailedLookupLocations: ReadonlyArray | undefined, failedLookupLocations: ReadonlyArray) { - if (failedLookupLocations) { - if (existingFailedLookupLocations) { - const existingWatches = arrayToMap(existingFailedLookupLocations, toPath); - for (const failedLookupLocation of failedLookupLocations) { - const failedLookupLocationPath = toPath(failedLookupLocation); - if (existingWatches && existingWatches.has(failedLookupLocationPath)) { - // still has same failed lookup location, keep the watch - existingWatches.delete(failedLookupLocationPath); - } - else { - // Create new watch - watchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, containingFile, name); - } - } + // Watch all the failed lookup locations + withFailedLookupLocations(failedLookupLocations, containingFile, name, watchFailedLookupLocation); - // Close all the watches that are still present in the existingWatches since those are not the locations looked up for buy new resolution - existingWatches.forEach((failedLookupLocation, failedLookupLocationPath: Path) => - closeFailedLookupLocationWatcher(failedLookupLocation, failedLookupLocationPath, containingFile, name) - ); - } - else { - // Watch all the failed lookup locations - withFailedLookupLocations(failedLookupLocations, containingFile, name, watchFailedLookupLocation); - } - } - else { - // Close existing watches for the failed locations - withFailedLookupLocations(existingFailedLookupLocations, containingFile, name, closeFailedLookupLocationWatcher); - } + // Close existing watches for the failed locations + withFailedLookupLocations(existingFailedLookupLocations, containingFile, name, closeFailedLookupLocationWatcher); } function invalidateResolutionCacheOfDeletedFile( diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 6cbc526324..884ee518a3 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1023,7 +1023,7 @@ namespace ts.server { if (this.configuredProjects.has(canonicalConfigFilePath)) { watches.push(WatchType.ConfigFilePath); } - this.logger.info(`ConfigFilePresence:: Current Watches: ['${watches.join("','")}']:: File: ${configFileName} Currently impacted open files: RootsOfInferredProjects: ${inferredRoots} OtherOpenFiles: ${otherFiles} Status: ${status}`); + this.logger.info(`ConfigFilePresence:: Current Watches: ${watches}:: File: ${configFileName} Currently impacted open files: RootsOfInferredProjects: ${inferredRoots} OtherOpenFiles: ${otherFiles} Status: ${status}`); } /**