Change:
Version: 1.59.0-insider (user setup) Commit: Date: 2021-08-04T09:44:34.203Z (1 day ago) Electron: 13.1.7 Chrome: 91.0.4472.124 14.16.0 V8: 9.1.269.36-electron.0 OS: Windows_NT x64 10.0. Steps to Reproduce: In a Python notebook or interactive session done click on "show more (open the raw output data in a text editor) ..." ! I would have expected to just see a file with numbers from 1 to 1000
Make sense to me. For single mimetype output, we should directly convert that to the right format.

Discussion:
import { isCompositeNotebookEditorInput, NotebookEditorInput, NotebookEditorInputOptions } from 'vs/workbench/contrib/notebook/common/notebookEditorInput'; import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService'; import { NotebookService } from 'vs/workbench/contrib/notebook/browser/notebookServiceImpl'; <del> import { CellKind, CellToolbarLocation, CellToolbarVisibility, CellUri, DisplayOrderKey, UndoRedoPerCell, IResolvedNotebookEditorModel, NotebookDocumentBackupData, NotebookTextDiffEditorPreview, NotebookWorkingCopyTypeIdentifier, ShowCellStatusBar, CompactView, FocusIndicator, InsertToolbarLocation, GlobalToolbar, ConsolidatedOutputButton, ShowFoldingControls, DragAndDropEnabled, NotebookCellEditorOptionsCustomizations, ConsolidatedRunButton, TextOutputLineLimit, GlobalToolbarShowLabel } from 'vs/workbench/contrib/notebook/common/notebookCommon'; </del> <ins> import { CellKind, CellToolbarLocation, CellToolbarVisibility, CellUri, DisplayOrderKey, UndoRedoPerCell, IResolvedNotebookEditorModel, NotebookDocumentBackupData, NotebookTextDiffEditorPreview, NotebookWorkingCopyTypeIdentifier, ShowCellStatusBar, CompactView, FocusIndicator, InsertToolbarLocation, GlobalToolbar, ConsolidatedOutputButton, ShowFoldingControls, DragAndDropEnabled, NotebookCellEditorOptionsCustomizations, ConsolidatedRunButton, TextOutputLineLimit, GlobalToolbarShowLabel, IOutputItemDto } from 'vs/workbench/contrib/notebook/common/notebookCommon'; </ins> import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; import { INotebookEditorModelResolverService } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverService';

return result; } <ins> private _getStreamOutputData(outputs: IOutputItemDto[]) { if (!outputs.length) { return null; } const first = outputs[0]; const mime = first.mime; const sameStream = !outputs.find(op => op.mime !== mime); if (sameStream) { return outputs.map(opit => new TextDecoder().decode(opit.data)).join(''); } else { return null; } } </ins> async provideOutputTextContent(resource: URI): Promise<ITextModel | null> { const existing = this._modelService.getModel(resource); if (existing) {

for (const cell of ref.object.notebook.cells) { if (cell.handle === data.handle) { <ins> if (cell.outputs.length === 1) { // single output const streamOutputData = this._getStreamOutputData(cell.outputs[0].outputs); if (streamOutputData) { result = this._modelService.createModel( streamOutputData, this._modeService.create('plaintext'), resource ); break; } } </ins> const content = JSON.stringify(cell.outputs.map(output => ({ metadata: output.metadata, outputItems: output.outputs.map(opit => ({