提交 ff681a5d 编写于 作者: R Rob Lourens

Ensure final cell execution update is not delayed

上级 8b598d67
......@@ -834,7 +834,6 @@ suite('Notebook API tests', function () {
assert.ok(cell.executionSummary);
assert.strictEqual(cell.executionSummary!.success, true);
assert.strictEqual(typeof cell.executionSummary!.executionOrder, 'number');
});
test('initialize executionSummary', async () => {
......
......@@ -468,6 +468,10 @@ class NotebookCellExecutionTask extends Disposable {
runEndTime: endTime,
lastRunSuccess: success
});
// The last update needs to be ordered correctly and applied immediately,
// so we use updateSoon and immediately flush.
that._collector.flush();
},
clearOutput(cell?: vscode.NotebookCell): Thenable<void> {
......@@ -511,13 +515,17 @@ class TimeoutBasedCollector<T> {
this.batch.push(item);
if (!this.waitPromise) {
this.waitPromise = timeout(this.delay).then(() => {
this.waitPromise = undefined;
const batch = this.batch;
this.batch = [];
return this.callback(batch);
return this.flush();
});
}
return this.waitPromise;
}
flush(): void | Promise<void> {
this.waitPromise = undefined;
const batch = this.batch;
this.batch = [];
return this.callback(batch);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册