Skip to content

Commit 456227b

Browse files
committed
Move invalidate typings cache to UpdateGraphWorker
1 parent 6ea624a commit 456227b

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/server/editorServices.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ namespace ts.server {
301301
let shouldRefreshInferredProjects = false;
302302
for (const p of projects) {
303303
if (!p.updateGraph()) {
304-
this.typingsCache.invalidateCachedTypingsForProject(p);
305304
shouldRefreshInferredProjects = true;
306305
}
307306
}

src/server/project.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ namespace ts.server {
312312
// - newProgram is different from the old program and structure of the old program was not reused.
313313
if (!oldProgram || (this.program !== oldProgram && !oldProgram.structureIsReused)) {
314314
hasChanges = true;
315+
this.projectService.typingsCache.invalidateCachedTypingsForProject(this);
315316
if (oldProgram) {
316317
for (const f of oldProgram.getSourceFiles()) {
317318
if (this.program.getSourceFileByPath(f.path)) {
@@ -414,9 +415,6 @@ namespace ts.server {
414415
removed.push(id);
415416
}
416417
}
417-
if (added.length > 0 || removed.length > 0) {
418-
this.projectService.typingsCache.invalidateCachedTypingsForProject(this);
419-
}
420418
this.lastReportedFileNames = currentFiles;
421419

422420
this.lastReportedFileNames = currentFiles;

0 commit comments

Comments
 (0)