Make sure we don't try calling a cached getErr on a closed resources that are in the getErr queue

This commit is contained in:
Matt Bierner 2019-11-08 13:28:24 -08:00
parent 59ba1190b4
commit 7218d47251

View file

@ -427,6 +427,7 @@ export default class BufferSyncSupport extends Disposable {
return; return;
} }
this.pendingDiagnostics.delete(resource); this.pendingDiagnostics.delete(resource);
this.pendingGetErr?.files.delete(resource);
this.syncedBuffers.delete(resource); this.syncedBuffers.delete(resource);
syncedBuffer.close(); syncedBuffer.close();
this._onDelete.fire(resource); this._onDelete.fire(resource);
@ -523,7 +524,9 @@ export default class BufferSyncSupport extends Disposable {
this.pendingGetErr.cancel(); this.pendingGetErr.cancel();
for (const file of this.pendingGetErr.files.entries) { for (const file of this.pendingGetErr.files.entries) {
orderedFileSet.set(file.resource, undefined); if (this.syncedBuffers.get(file.resource)) {
orderedFileSet.set(file.resource, undefined);
}
} }
} }