@@ -8,7 +8,7 @@ import { Emitter, Event } from 'vs/base/common/event';
88import { Disposable } from 'vs/base/common/lifecycle' ;
99import { CellKind , MainThreadNotebookShape } from 'vs/workbench/api/common/extHost.protocol' ;
1010import * as extHostTypes from 'vs/workbench/api/common/extHostTypes' ;
11- import { addIdToOutput , CellEditType , ICellEditOperation , ICellReplaceEdit , INotebookEditData , NotebookDocumentMetadata , notebookDocumentMetadataDefaults } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
11+ import { addIdToOutput , CellEditType , ICellEditOperation , ICellReplaceEdit , INotebookEditData , notebookDocumentMetadataDefaults } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
1212import * as vscode from 'vscode' ;
1313import { ExtHostNotebookDocument } from './extHostNotebookDocument' ;
1414
@@ -18,7 +18,6 @@ class NotebookEditorCellEditBuilder implements vscode.NotebookEditorEdit {
1818
1919 private _finalized : boolean = false ;
2020 private _collectedEdits : ICellEditOperation [ ] = [ ] ;
21- private _newNotebookDocumentMetadata ?: NotebookDocumentMetadata ;
2221
2322 constructor ( documentVersionId : number ) {
2423 this . _documentVersionId = documentVersionId ;
@@ -28,8 +27,7 @@ class NotebookEditorCellEditBuilder implements vscode.NotebookEditorEdit {
2827 this . _finalized = true ;
2928 return {
3029 documentVersionId : this . _documentVersionId ,
31- cellEdits : this . _collectedEdits ,
32- newMetadata : this . _newNotebookDocumentMetadata
30+ cellEdits : this . _collectedEdits
3331 } ;
3432 }
3533
@@ -41,7 +39,10 @@ class NotebookEditorCellEditBuilder implements vscode.NotebookEditorEdit {
4139
4240 replaceNotebookMetadata ( value : vscode . NotebookDocumentMetadata ) : void {
4341 this . _throwIfFinalized ( ) ;
44- this . _newNotebookDocumentMetadata = { ...notebookDocumentMetadataDefaults , ...value } ;
42+ this . _collectedEdits . push ( {
43+ editType : CellEditType . DocumentMetadata ,
44+ metadata : { ...notebookDocumentMetadataDefaults , ...value }
45+ } ) ;
4546 }
4647
4748 replaceCellMetadata ( index : number , metadata : vscode . NotebookCellMetadata ) : void {
@@ -235,7 +236,7 @@ export class ExtHostNotebookEditor extends Disposable implements vscode.Notebook
235236 compressedEditsIndex ++ ;
236237 }
237238
238- return this . _proxy . $tryApplyEdits ( this . _viewType , this . document . uri , editData . documentVersionId , compressedEdits , editData . newMetadata ) ;
239+ return this . _proxy . $tryApplyEdits ( this . _viewType , this . document . uri , editData . documentVersionId , compressedEdits ) ;
239240 }
240241
241242 revealRange ( range : vscode . NotebookCellRange , revealType ?: extHostTypes . NotebookEditorRevealType ) {
0 commit comments