mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
clear cell output in the core
This commit is contained in:
@@ -251,6 +251,10 @@ export class ExtHostNotebookDocument extends Disposable implements vscode.Notebo
|
||||
this.$spliceNotebookCells(event.changes);
|
||||
} else if (event.kind === NotebookCellsChangeType.Move) {
|
||||
this.$moveCell(event.index, event.newIdx);
|
||||
} else if (event.kind === NotebookCellsChangeType.CellClearOutput) {
|
||||
this.$clearCellOutputs(event.index);
|
||||
} else if (event.kind === NotebookCellsChangeType.CellsClearOutput) {
|
||||
this.$clearAllCellOutputs();
|
||||
}
|
||||
|
||||
this._versionId = event.versionId;
|
||||
@@ -299,6 +303,15 @@ export class ExtHostNotebookDocument extends Disposable implements vscode.Notebo
|
||||
this.cells.splice(newIdx, 0, ...cells);
|
||||
}
|
||||
|
||||
private $clearCellOutputs(index: number) {
|
||||
const cell = this.cells[index];
|
||||
cell.outputs = [];
|
||||
}
|
||||
|
||||
private $clearAllCellOutputs() {
|
||||
this.cells.forEach(cell => cell.outputs = []);
|
||||
}
|
||||
|
||||
eventuallyUpdateCellOutputs(cell: ExtHostCell, diffs: ISplice<vscode.CellOutput>[]) {
|
||||
let renderers = new Set<number>();
|
||||
let outputDtos: NotebookCellOutputsSplice[] = diffs.map(diff => {
|
||||
|
||||
Reference in New Issue
Block a user