mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
make sure replaceOutput updates the extension host side, update tests https://github.com/microsoft/vscode/issues/105283
This commit is contained in:
@@ -139,6 +139,10 @@ export class ExtHostCell extends Disposable {
|
||||
this._onDidDispose.fire();
|
||||
}
|
||||
|
||||
setOutputs(newOutputs: vscode.CellOutput[]): void {
|
||||
this._outputs = newOutputs;
|
||||
}
|
||||
|
||||
private _updateOutputs(newOutputs: vscode.CellOutput[]) {
|
||||
const rawDiffs = diff<vscode.CellOutput>(this._outputs || [], newOutputs || [], (a) => {
|
||||
return this._outputMapping.has(a);
|
||||
@@ -321,6 +325,8 @@ export class ExtHostNotebookDocument extends Disposable {
|
||||
this._spliceNotebookCells(event.changes, false);
|
||||
} else if (event.kind === NotebookCellsChangeType.Move) {
|
||||
this._moveCell(event.index, event.newIdx);
|
||||
} else if (event.kind === NotebookCellsChangeType.Output) {
|
||||
this._setCellOutputs(event.index, event.outputs);
|
||||
} else if (event.kind === NotebookCellsChangeType.CellClearOutput) {
|
||||
this._clearCellOutputs(event.index);
|
||||
} else if (event.kind === NotebookCellsChangeType.CellsClearOutput) {
|
||||
@@ -412,6 +418,12 @@ export class ExtHostNotebookDocument extends Disposable {
|
||||
});
|
||||
}
|
||||
|
||||
private _setCellOutputs(index: number, outputs: IProcessedOutput[]): void {
|
||||
const cell = this._cells[index];
|
||||
cell.setOutputs(outputs);
|
||||
this._emitter.emitCellOutputsChange({ document: this.notebookDocument, cells: [cell.cell] });
|
||||
}
|
||||
|
||||
private _clearCellOutputs(index: number): void {
|
||||
const cell = this._cells[index].cell;
|
||||
cell.outputs = [];
|
||||
|
||||
Reference in New Issue
Block a user