src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.ts/NotebookCellTextModel/changeOutputItems
class NotebookCellTextModel:	changeOutputItems(outputId: string, append: boolean, items: IOutputItemDto[]): boolean {
		const outputIndex = this.outputs.findIndex(output => output.outputId === outputId);

		if (outputIndex < 0) {
			return false;
		}

		const output = this.outputs[outputIndex];
		if (append) {
			output.appendData(items);
		} else {
			output.replaceData(items);
		}
		if (output.outputs.length > 1 && output.outputs.every(item => isTextStreamMime(item.mime))) {
			// Look for the mimes in the items, and keep track of their order.
			// Merge the streams into one output item, per mime type.
			const mimeOutputs = new Map<string, Uint8Array[]>();
			const mimeTypes: string[] = [];
			output.outputs.forEach(item => {
				let items: Uint8Array[];
				if (mimeOutputs.has(item.mime)) {
					items = mimeOutputs.get(item.mime)!;
				} else {
					items = [];
					mimeOutputs.set(item.mime, items);
					mimeTypes.push(item.mime);
				}
				items.push(item.data.buffer);
			});
			output.outputs.length = 0;
			mimeTypes.forEach(mime => {
				const compressed = compressOutputItemStreams(mimeOutputs.get(mime)!);
				output.outputs.push({
					mime,
					data: compressed
				});
			});
		}

		this._onDidChangeOutputItems.fire();
		return true;
	}