If there are no open files, do not schedule ensureProjectForOpenFiles (#41537)

This commit is contained in:
Sheetal Nandi
2020-11-18 16:10:11 -08:00
committed by GitHub
parent 9bbbe5c0c7
commit 2cc67ec0a6
5 changed files with 16 additions and 6 deletions

View File

@@ -930,6 +930,7 @@ namespace ts.server {
/*@internal*/
delayEnsureProjectForOpenFiles() {
if (!this.openFiles.size) return;
this.pendingEnsureProjectForOpenFiles = true;
this.throttledOperations.schedule(ensureProjectForOpenFileSchedule, /*delay*/ 2500, () => {
if (this.pendingProjectUpdates.size !== 0) {