Skip to content

Commit 3c7b213

Browse files
committed
PR updates
1 parent aa03a04 commit 3c7b213

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/server/editorServices.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,11 @@ namespace ts.server {
364364
}
365365

366366
private onTypeRootFileChanged(project: ConfiguredProject, fileName: string) {
367-
this.updateConfiguredProject(project);
368-
this.refreshInferredProjects();
367+
this.logger.info(`Type root file ${fileName} changed`);
368+
this.throttledOperations.schedule(project.configFileName, /*delay*/ 250, () => {
369+
this.updateConfiguredProject(project);
370+
this.refreshInferredProjects();
371+
});
369372
}
370373

371374
/**

src/server/project.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,13 +611,11 @@ namespace ts.server {
611611
}
612612

613613
watchTypeRoots(callback: (project: ConfiguredProject, path: string) => void) {
614-
const roots = ts.getEffectiveTypeRoots(this.getCompilerOptions(), this.projectService.host);
614+
const roots = this.getEffectiveTypeRoots();
615615
const watchers: FileWatcher[] = [];
616-
if (roots) {
617-
for (const root of roots) {
618-
this.projectService.logger.info(`Add type root watcher for: ${root}`);
619-
watchers.push(this.projectService.host.watchDirectory(root, path => callback(this, path), true));
620-
}
616+
for (const root of roots) {
617+
this.projectService.logger.info(`Add type root watcher for: ${root}`);
618+
watchers.push(this.projectService.host.watchDirectory(root, path => callback(this, path), /*recursive*/ false));
621619
}
622620
this.typeRootsWatchers = watchers;
623621
}

0 commit comments

Comments
 (0)