This commit is contained in:
Ryan Cavanaugh 2016-09-19 17:00:10 -07:00
parent 2612a74f63
commit 6de3dc4f8b
2 changed files with 1 additions and 4 deletions

View file

@ -394,13 +394,11 @@ namespace ts.server {
const newRootFiles = projectOptions.files.map((f => this.getCanonicalFileName(f)));
const currentRootFiles = project.getRootFiles().map((f => this.getCanonicalFileName(f)));
const lastUpdateTypesRoot: number = Math.max.apply(Math, project.getEffectiveTypeRoots().map(root => {
this.logger.info('Compute for ' + root);
if (this.host.directoryExists(root)) {
return +this.host.getModifiedTime(root);
}
return 0;
}));
this.logger.info('Last type roots update = ' + lastUpdateTypesRoot + ', last was ' + project.lastUpdatedTypesRootTime);
// We check if the project file list has changed. If so, we update the project.
if (!arrayIsEqualTo(currentRootFiles.sort(), newRootFiles.sort()) || (lastUpdateTypesRoot > project.lastUpdatedTypesRootTime)) {
@ -794,7 +792,7 @@ namespace ts.server {
}
private watchConfigDirectoryForProject(project: ConfiguredProject, options: ProjectOptions): void {
if (!options.configHasFilesProperty || (options.compilerOptions.types === undefined)) {
if (!options.configHasFilesProperty) {
project.watchConfigDirectory((project, path) => this.onSourceFileInDirectoryChangedForConfiguredProject(project, path));
}
}

View file

@ -612,7 +612,6 @@ namespace ts.server {
watchTypeRoots(callback: (project: ConfiguredProject, path: string) => void) {
const roots = ts.getEffectiveTypeRoots(this.getCompilerOptions(), this.projectService.host);
this.projectService.logger.info(`Add type roots watchers for: ${roots}`);
const watchers: FileWatcher[] = [];
if (roots) {
for (const root of roots) {