move convert logic into extHostTypeConverters

This commit is contained in:
Johannes Rieken
2021-02-08 09:09:42 +01:00
parent 659245f86c
commit 4821adfc12
3 changed files with 10 additions and 9 deletions

View File

@@ -13,6 +13,7 @@ import { URI } from 'vs/base/common/uri';
import { CellKind, INotebookDocumentPropertiesChangeData, IWorkspaceCellEditDto, MainThreadBulkEditsShape, MainThreadNotebookShape, WorkspaceEditType } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostDocumentsAndEditors, IExtHostModelAddedData } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
import { NotebookCellOutput } from 'vs/workbench/api/common/extHostTypes';
import * as extHostTypeConverters from 'vs/workbench/api/common/extHostTypeConverters';
import { CellEditType, IMainCellDto, IOutputDto, NotebookCellMetadata, NotebookCellsChangedEventDto, NotebookCellsChangeType, NotebookCellsSplice2, notebookDocumentMetadataDefaults } from 'vs/workbench/contrib/notebook/common/notebookCommon';
import * as vscode from 'vscode';
@@ -117,7 +118,7 @@ export class ExtHostCell extends Disposable {
return that._outputs.map(output => NotebookCellOutput._toOld(output));
},
set outputs(_value) { throw new Error('Use WorkspaceEdit to update cell outputs.'); },
get outputs2() { return that._outputs.map(output => NotebookCellOutput._fromDto(output, output.outputId)); },
get outputs2() { return that._outputs.map(extHostTypeConverters.NotebookCellOutput.to); },
set outputs2(_value) { throw new Error('Use WorkspaceEdit to update cell outputs.'); },
get metadata() { return that._metadata; },
set metadata(_value) { throw new Error('Use WorkspaceEdit to update cell metadata.'); },