From 758d8de8f94eba25299f35e6ebfb1e6df7d0001e Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 16 Aug 2016 14:49:45 -0700 Subject: [PATCH] record projectName instead of projectRootPath --- src/server/typingsInstaller/typingsInstaller.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 87e5c8fb7dc..b7862431869 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -134,7 +134,7 @@ namespace ts.server.typingsInstaller { this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths)); // start watching files - this.watchFiles(req.projectRootPath, discoverTypingsResult.filesToWatch); + this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch); // install typings this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames); @@ -255,7 +255,7 @@ namespace ts.server.typingsInstaller { } } - private watchFiles(projectRootPath: string, files: string[]) { + private watchFiles(projectName: string, files: string[]) { if (!files.length) { return; } @@ -263,12 +263,10 @@ namespace ts.server.typingsInstaller { for (const file of files) { const w = this.installTypingHost.watchFile(file, f => { if (this.log.isEnabled()) { - this.log.writeLine(`FS notification for '${f}', sending 'clean' message for project '${projectRootPath}'`); + this.log.writeLine(`FS notification for '${f}', sending 'clean' message for project '${projectName}'`); } - if (!this.closeWatchers(projectRootPath)) { - return; - } - this.sendResponse({ projectName: projectRootPath, kind: "invalidate" }) + this.closeWatchers(projectName); + this.sendResponse({ projectName: projectName, kind: "invalidate" }) }); watchers.push(w); }