Skip to content

Commit 758d8de

Browse files
committed
record projectName instead of projectRootPath
1 parent f0e1f9b commit 758d8de

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/server/typingsInstaller/typingsInstaller.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ namespace ts.server.typingsInstaller {
134134
this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths));
135135

136136
// start watching files
137-
this.watchFiles(req.projectRootPath, discoverTypingsResult.filesToWatch);
137+
this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch);
138138

139139
// install typings
140140
this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames);
@@ -255,20 +255,18 @@ namespace ts.server.typingsInstaller {
255255
}
256256
}
257257

258-
private watchFiles(projectRootPath: string, files: string[]) {
258+
private watchFiles(projectName: string, files: string[]) {
259259
if (!files.length) {
260260
return;
261261
}
262262
const watchers: FileWatcher[] = [];
263263
for (const file of files) {
264264
const w = this.installTypingHost.watchFile(file, f => {
265265
if (this.log.isEnabled()) {
266-
this.log.writeLine(`FS notification for '${f}', sending 'clean' message for project '${projectRootPath}'`);
266+
this.log.writeLine(`FS notification for '${f}', sending 'clean' message for project '${projectName}'`);
267267
}
268-
if (!this.closeWatchers(projectRootPath)) {
269-
return;
270-
}
271-
this.sendResponse(<InvalidateCachedTypings>{ projectName: projectRootPath, kind: "invalidate" })
268+
this.closeWatchers(projectName);
269+
this.sendResponse(<InvalidateCachedTypings>{ projectName: projectName, kind: "invalidate" })
272270
});
273271
watchers.push(w);
274272
}

0 commit comments

Comments
 (0)