Re-queue canceled geterr requests before remaining buffers

We should give higher priority to files that have previously had geterr triggered on them but did not have their request completed
This commit is contained in:
Matt Bierner 2019-06-20 00:18:25 -07:00
parent 7679015e6f
commit 8b93c01655

View file

@ -470,20 +470,20 @@ export default class BufferSyncSupport extends Disposable {
private sendPendingDiagnostics(): void {
const orderedFileSet = this.pendingDiagnostics.getOrderedFileSet();
if (this.pendingGetErr) {
this.pendingGetErr.cancel();
for (const file of this.pendingGetErr.files.entries) {
orderedFileSet.set(file.resource, undefined);
}
}
// Add all open TS buffers to the geterr request. They might be visible
for (const buffer of this.syncedBuffers.values) {
orderedFileSet.set(buffer.resource, undefined);
}
if (orderedFileSet.size) {
if (this.pendingGetErr) {
this.pendingGetErr.cancel();
for (const file of this.pendingGetErr.files.entries) {
orderedFileSet.set(file.resource, undefined);
}
}
const getErr = this.pendingGetErr = GetErrRequest.executeGetErrRequest(this.client, orderedFileSet, () => {
if (this.pendingGetErr === getErr) {
this.pendingGetErr = undefined;