src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts/NotebookEditorWidget/layoutNotebookCell
class NotebookEditorWidget:	async layoutNotebookCell(cell: ICellViewModel, height: number, context?: CellLayoutContext): Promise<void> {
		this._debug('layout cell', cell.handle, height);
		const viewIndex = this._list.getViewIndex(cell);
		if (viewIndex === undefined) {
			// the cell is hidden
			return;
		}

		const relayout = (cell: ICellViewModel, height: number) => {
			if (this._isDisposed) {
				return;
			}

			this._list.updateElementHeight2(cell, height);
		};

		if (this._pendingLayouts?.has(cell)) {
			this._pendingLayouts?.get(cell)!.dispose();
		}

		let deferred = new DeferredPromise<void>();
		const doLayout = () => {
			if (this._isDisposed) {
				return;
			}

			if (this._list.elementHeight(cell) === height) {
				return;
			}

			this._pendingLayouts?.delete(cell);

			relayout(cell, height);
			deferred.complete(undefined);
		};

		if (context === CellLayoutContext.Fold) {
			doLayout();
		} else {
			const layoutDisposable = DOM.scheduleAtNextAnimationFrame(doLayout);

			this._pendingLayouts?.set(cell, toDisposable(() => {
				layoutDisposable.dispose();
				deferred.complete(undefined);
			}));
		}

		return deferred.p;
	}