Adds cancellation to md diagnostic computer (#149122)

This tracks inflight diagnostic computation and tries to cancel them if a new request comes in for the same document (usually because the document has changed or has been closed)
This commit is contained in:
Matt Bierner
2022-05-09 15:42:32 -07:00
committed by GitHub
parent a6dd083a7e
commit d850919250
3 changed files with 84 additions and 27 deletions

View File

@@ -25,6 +25,10 @@ export class Delayer<T> {
this.task = null;
}
dispose() {
this.cancelTimeout();
}
public trigger(task: ITask<T>, delay: number = this.defaultDelay): Promise<T | null> {
this.task = task;
if (delay >= 0) {