6
6
import { readonly } from 'vs/base/common/errors' ;
7
7
import { Emitter , Event } from 'vs/base/common/event' ;
8
8
import { Disposable } from 'vs/base/common/lifecycle' ;
9
- import { CellKind , MainThreadNotebookShape } from 'vs/workbench/api/common/extHost.protocol' ;
9
+ import { MainThreadNotebookShape } from 'vs/workbench/api/common/extHost.protocol' ;
10
10
import * as extHostTypes from 'vs/workbench/api/common/extHostTypes' ;
11
11
import { addIdToOutput , CellEditType , ICellEditOperation , ICellReplaceEdit , INotebookEditData , notebookDocumentMetadataDefaults } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
12
12
import * as vscode from 'vscode' ;
@@ -37,7 +37,7 @@ class NotebookEditorCellEditBuilder implements vscode.NotebookEditorEdit {
37
37
}
38
38
}
39
39
40
- replaceNotebookMetadata ( value : vscode . NotebookDocumentMetadata ) : void {
40
+ replaceMetadata ( value : vscode . NotebookDocumentMetadata ) : void {
41
41
this . _throwIfFinalized ( ) ;
42
42
this . _collectedEdits . push ( {
43
43
editType : CellEditType . DocumentMetadata ,
@@ -54,12 +54,6 @@ class NotebookEditorCellEditBuilder implements vscode.NotebookEditorEdit {
54
54
} ) ;
55
55
}
56
56
57
- replaceMetadata ( index : number , metadata : vscode . NotebookCellMetadata ) : void {
58
- console . warn ( 'DEPRECATED use "replaceCellMetadata" instead' ) ;
59
- this . replaceCellMetadata ( index , metadata ) ;
60
- }
61
-
62
-
63
57
replaceCellOutput ( index : number , outputs : vscode . CellOutput [ ] ) : void {
64
58
this . _throwIfFinalized ( ) ;
65
59
this . _collectedEdits . push ( {
@@ -69,14 +63,8 @@ class NotebookEditorCellEditBuilder implements vscode.NotebookEditorEdit {
69
63
} ) ;
70
64
}
71
65
72
- replaceOutput ( index : number , outputs : vscode . CellOutput [ ] ) : void {
73
- console . warn ( 'DEPRECATED use "replaceCellOutput" instead' ) ;
74
- this . replaceCellOutput ( index , outputs ) ;
75
- }
76
-
77
66
replaceCells ( from : number , to : number , cells : vscode . NotebookCellData [ ] ) : void {
78
67
this . _throwIfFinalized ( ) ;
79
-
80
68
this . _collectedEdits . push ( {
81
69
editType : CellEditType . Replace ,
82
70
index : from ,
@@ -89,22 +77,6 @@ class NotebookEditorCellEditBuilder implements vscode.NotebookEditorEdit {
89
77
} )
90
78
} ) ;
91
79
}
92
-
93
- insert ( index : number , content : string | string [ ] , language : string , type : CellKind , outputs : vscode . CellOutput [ ] , metadata : vscode . NotebookCellMetadata | undefined ) : void {
94
- this . _throwIfFinalized ( ) ;
95
- this . replaceCells ( index , index , [ {
96
- language,
97
- outputs,
98
- metadata,
99
- cellKind : type ,
100
- source : Array . isArray ( content ) ? content . join ( '\n' ) : content ,
101
- } ] ) ;
102
- }
103
-
104
- delete ( index : number ) : void {
105
- this . _throwIfFinalized ( ) ;
106
- this . replaceCells ( index , 1 , [ ] ) ;
107
- }
108
80
}
109
81
110
82
export class ExtHostNotebookEditor extends Disposable implements vscode . NotebookEditor {
0 commit comments