@@ -9,7 +9,7 @@ import { MainContext, MainThreadNotebookShape, NotebookExtensionDescription, IEx
99import { Disposable , IDisposable , combinedDisposable , DisposableStore } from 'vs/base/common/lifecycle' ;
1010import { URI , UriComponents } from 'vs/base/common/uri' ;
1111import { INotebookService , IMainNotebookController } from 'vs/workbench/contrib/notebook/common/notebookService' ;
12- import { INotebookMimeTypeSelector , NOTEBOOK_DISPLAY_ORDER , NotebookCellOutputsSplice , NotebookDocumentMetadata , NotebookCellMetadata , ICellEditOperation , ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER , CellEditType , CellKind , INotebookKernelInfo , INotebookKernelInfoDto , IEditor , INotebookRendererInfo , IOutputRenderRequest , IOutputRenderResponse , INotebookDocumentFilter } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
12+ import { NOTEBOOK_DISPLAY_ORDER , NotebookCellOutputsSplice , NotebookDocumentMetadata , NotebookCellMetadata , ICellEditOperation , ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER , CellEditType , CellKind , INotebookKernelInfo , INotebookKernelInfoDto , IEditor , INotebookDocumentFilter } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
1313import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
1414import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel' ;
1515import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
@@ -171,7 +171,6 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo
171171 private readonly _notebookProviders = new Map < string , IMainNotebookController > ( ) ;
172172 private readonly _notebookKernels = new Map < string , MainThreadNotebookKernel > ( ) ;
173173 private readonly _notebookKernelProviders = new Map < number , { extension : NotebookExtensionDescription , emitter : Emitter < void > , provider : IDisposable } > ( ) ;
174- private readonly _notebookRenderers = new Map < string , MainThreadNotebookRenderer > ( ) ;
175174 private readonly _proxy : ExtHostNotebookShape ;
176175 private _toDisposeOnEditorRemove = new Map < string , IDisposable > ( ) ;
177176 private _currentState ?: DocumentAndEditorState ;
@@ -191,10 +190,10 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo
191190 this . registerListeners ( ) ;
192191 }
193192
194- async $tryApplyEdits ( viewType : string , resource : UriComponents , modelVersionId : number , edits : ICellEditOperation [ ] , renderers : number [ ] ) : Promise < boolean > {
193+ async $tryApplyEdits ( viewType : string , resource : UriComponents , modelVersionId : number , edits : ICellEditOperation [ ] ) : Promise < boolean > {
195194 const textModel = this . _notebookService . getNotebookTextModel ( URI . from ( resource ) ) ;
196195 if ( textModel ) {
197- await this . _notebookService . transformEditsOutputs ( textModel , edits ) ;
196+ this . _notebookService . transformEditsOutputs ( textModel , edits ) ;
198197 return textModel . $applyEdit ( modelVersionId , edits , true ) ;
199198 }
200199
@@ -414,22 +413,6 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo
414413 // }
415414 }
416415
417- async $registerNotebookRenderer ( extension : NotebookExtensionDescription , type : string , selectors : INotebookMimeTypeSelector , preloads : UriComponents [ ] ) : Promise < void > {
418- const staticContribution = this . _notebookService . getContributedNotebookOutputRenderers ( type ) ;
419-
420- if ( ! staticContribution ) {
421- throw new Error ( `Notebook renderer for '${ type } ' is not statically registered.` ) ;
422- }
423-
424- const renderer = new MainThreadNotebookRenderer ( this . _proxy , type , staticContribution . displayName , extension . id , URI . revive ( extension . location ) , selectors , preloads . map ( uri => URI . revive ( uri ) ) ) ;
425- this . _notebookRenderers . set ( type , renderer ) ;
426- this . _notebookService . registerNotebookRenderer ( type , renderer ) ;
427- }
428-
429- async $unregisterNotebookRenderer ( id : string ) : Promise < void > {
430- this . _notebookService . unregisterNotebookRenderer ( id ) ;
431- }
432-
433416 async $registerNotebookProvider ( _extension : NotebookExtensionDescription , _viewType : string , _supportBackup : boolean , _kernel : INotebookKernelInfoDto | undefined ) : Promise < void > {
434417 const controller : IMainNotebookController = {
435418 kernel : _kernel ,
@@ -448,7 +431,7 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo
448431 { editType : CellEditType . Insert , index : 0 , cells : data . cells }
449432 ] ;
450433
451- await this . _notebookService . transformEditsOutputs ( mainthreadTextModel , edits ) ;
434+ this . _notebookService . transformEditsOutputs ( mainthreadTextModel , edits ) ;
452435 await new Promise ( resolve => {
453436 DOM . scheduleAtNextAnimationFrame ( ( ) => {
454437 const ret = mainthreadTextModel ! . $applyEdit ( mainthreadTextModel ! . versionId , edits , true ) ;
@@ -609,12 +592,12 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo
609592 textModel ?. updateNotebookCellMetadata ( handle , metadata ) ;
610593 }
611594
612- async $spliceNotebookCellOutputs ( viewType : string , resource : UriComponents , cellHandle : number , splices : NotebookCellOutputsSplice [ ] , renderers : number [ ] ) : Promise < void > {
595+ async $spliceNotebookCellOutputs ( viewType : string , resource : UriComponents , cellHandle : number , splices : NotebookCellOutputsSplice [ ] ) : Promise < void > {
613596 this . logService . debug ( 'MainThreadNotebooks#spliceNotebookCellOutputs' , resource . path , cellHandle ) ;
614597 const textModel = this . _notebookService . getNotebookTextModel ( URI . from ( resource ) ) ;
615598
616599 if ( textModel ) {
617- await this . _notebookService . transformSpliceOutputs ( textModel , splices ) ;
600+ this . _notebookService . transformSpliceOutputs ( textModel , splices ) ;
618601 textModel . $spliceNotebookCellOutputs ( cellHandle , splices ) ;
619602 }
620603 }
@@ -675,25 +658,3 @@ export class MainThreadNotebookKernel implements INotebookKernelInfo {
675658 return this . _proxy . $executeNotebook2 ( this . id , viewType , uri , handle ) ;
676659 }
677660}
678-
679- export class MainThreadNotebookRenderer implements INotebookRendererInfo {
680- constructor (
681- private readonly _proxy : ExtHostNotebookShape ,
682- readonly id : string ,
683- public displayName : string ,
684- readonly extensionId : ExtensionIdentifier ,
685- readonly extensionLocation : URI ,
686- readonly selectors : INotebookMimeTypeSelector ,
687- readonly preloads : URI [ ] ,
688- ) {
689-
690- }
691-
692- render ( uri : URI , request : IOutputRenderRequest < UriComponents > ) : Promise < IOutputRenderResponse < UriComponents > | undefined > {
693- return this . _proxy . $renderOutputs ( uri , this . id , request ) ;
694- }
695-
696- render2 < T > ( uri : URI , request : IOutputRenderRequest < T > ) : Promise < IOutputRenderResponse < T > | undefined > {
697- return this . _proxy . $renderOutputs2 ( uri , this . id , request ) ;
698- }
699- }
0 commit comments