Should also check if there are no external projects before skipping scheduling

Fixes failing tests
This commit is contained in:
Sheetal Nandi 2020-11-13 17:03:44 -08:00
parent 08205196f2
commit 7e4939014a

View file

@ -923,7 +923,8 @@ namespace ts.server {
/*@internal*/
delayEnsureProjectForOpenFiles() {
if (!this.openFiles.size) return;
// If no open files or no external project, do not schedule
if (!this.openFiles.size && !this.externalProjects.length && !this.externalProjectToConfiguredProjectMap.size) return;
this.pendingEnsureProjectForOpenFiles = true;
this.throttledOperations.schedule("*ensureProjectForOpenFiles*", /*delay*/ 2500, () => {
if (this.pendingProjectUpdates.size !== 0) {