Move invalidate typings cache to UpdateGraphWorker

This commit is contained in:
Jason Ramsay 2016-08-29 16:43:34 -07:00
parent 6ea624a2fe
commit 456227bbee
2 changed files with 1 additions and 4 deletions

View File

@ -301,7 +301,6 @@ namespace ts.server {
let shouldRefreshInferredProjects = false;
for (const p of projects) {
if (!p.updateGraph()) {
this.typingsCache.invalidateCachedTypingsForProject(p);
shouldRefreshInferredProjects = true;
}
}

View File

@ -312,6 +312,7 @@ namespace ts.server {
// - newProgram is different from the old program and structure of the old program was not reused.
if (!oldProgram || (this.program !== oldProgram && !oldProgram.structureIsReused)) {
hasChanges = true;
this.projectService.typingsCache.invalidateCachedTypingsForProject(this);
if (oldProgram) {
for (const f of oldProgram.getSourceFiles()) {
if (this.program.getSourceFileByPath(f.path)) {
@ -414,9 +415,6 @@ namespace ts.server {
removed.push(id);
}
}
if (added.length > 0 || removed.length > 0) {
this.projectService.typingsCache.invalidateCachedTypingsForProject(this);
}
this.lastReportedFileNames = currentFiles;
this.lastReportedFileNames = currentFiles;