diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 2f6ba7aa3bb..d098c91eecf 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2028,7 +2028,7 @@ namespace ts.projectSystem { projectService.openExternalProject({ projectFileName, options: {}, rootFiles: [{ fileName: file1.path, scriptKind: ScriptKind.JS, hasMixedContent: true }] }); checkNumberOfProjects(projectService, { externalProjects: 1 }); - checkWatchedFiles(host, []); + checkWatchedFiles(host, [libFile.path]); // watching the "missing" lib file const project = projectService.externalProjects[0]; diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index 9483308287f..6c43ea1c034 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -731,7 +731,7 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { configuredProjects: 1 }); const p = projectService.configuredProjects[0]; checkProjectActualFiles(p, [app.path, jsconfig.path]); - checkWatchedFiles(host, [jsconfig.path, "/bower_components", "/node_modules"]); + checkWatchedFiles(host, [jsconfig.path, "/bower_components", "/node_modules", libFile.path]); installer.installAll(/*expectedCount*/ 1); diff --git a/src/server/project.ts b/src/server/project.ts index 18c203c194e..163510bad27 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -631,7 +631,7 @@ namespace ts.server { // Missing files that are not yet watched should be added to the map. missingFilePaths.forEach(p => { if (!this.missingFilesMap.contains(p)) { - const fileWatcher = ts.sys.watchFile(p, (_filename: string, removed?: boolean) => { + const fileWatcher = this.projectService.host.watchFile(p, (_filename: string, removed?: boolean) => { // removed = deleted ? true : (added ? false : undefined) if (removed === false && this.missingFilesMap.contains(p)) { fileWatcher.close();