create new cell should be stateless

This commit is contained in:
rebornix
2020-03-18 09:51:06 -07:00
parent 542818bfc9
commit 915d3da29e
2 changed files with 3 additions and 20 deletions

View File

@@ -217,7 +217,7 @@ export class MainThreadNotebookController implements IMainNotebookController {
mainthreadNotebook?.textModel.updateActiveCell(cellHandle);
}
async createRawCell2(uri: URI, index: number, language: string, type: CellKind): Promise<NotebookCellTextModel | undefined> {
async createRawCell(uri: URI, index: number, language: string, type: CellKind): Promise<NotebookCellTextModel | undefined> {
let cell = await this._proxy.$createEmptyCell(this._viewType, uri, index, language, type);
if (cell) {
let mainCell = new NotebookCellTextModel(URI.revive(cell.uri), cell.handle, cell.source, cell.language, cell.cellKind, cell.outputs);
@@ -227,12 +227,6 @@ export class MainThreadNotebookController implements IMainNotebookController {
return undefined;
}
async createRawCell(uri: URI, index: number, language: string, type: CellKind): Promise<ICell | undefined> {
let mainthreadNotebook = this._mapping.get(URI.from(uri).toString());
let cell = await this._proxy.$createEmptyCell(this._viewType, uri, index, language, type);
return mainthreadNotebook?.createRawCell(cell, index);
}
async deleteCell(uri: URI, index: number): Promise<boolean> {
let mainthreadNotebook = this._mapping.get(URI.from(uri).toString());