@@ -23,6 +23,7 @@ import {
2323} from '@jupyterlab/apputils' ;
2424import { KeyboardEvent } from 'react' ;
2525import { IToolbarWidgetRegistry } from '@jupyterlab/apputils' ;
26+ import { INotebookCellExecutor , runCell } from '@jupyterlab/notebook' ;
2627import { AwarenessExecutionIndicator } from './executionindicator' ;
2728
2829import { requestAPI } from './handler' ;
@@ -281,6 +282,28 @@ export const kernelStatus: JupyterFrontEndPlugin<IKernelStatusModel> = {
281282 }
282283} ;
283284
285+ /**
286+ * Notebook cell executor plugin, provided by JupyterLab by default. Re-provided
287+ * to ensure compatibility with `jupyter_collaboration`.
288+ *
289+ * The `@jupyter/docprovider-extension` disables this plugin to override it, but
290+ * we disable that labextension, leaving `INotebookCellExecutor` un-implemented.
291+ * This plugin fixes that issue by re-providing this plugin with `autoStart:
292+ * false`, which specifies that this plugin only gets activated if no other
293+ * implementation exists, e.g. only when `jupyter_collaboration` is installed.
294+ */
295+ export const backupCellExecutorPlugin : JupyterFrontEndPlugin < INotebookCellExecutor > =
296+ {
297+ id : '@jupyter/server-documents:backup-cell-executor' ,
298+ description :
299+ 'Provides a backup default implementation of the notebook cell executor.' ,
300+ autoStart : false ,
301+ provides : INotebookCellExecutor ,
302+ activate : ( ) : INotebookCellExecutor => {
303+ return Object . freeze ( { runCell } ) ;
304+ }
305+ } ;
306+
284307const plugins : JupyterFrontEndPlugin < unknown > [ ] = [
285308 rtcContentProvider ,
286309 yfile ,
@@ -291,7 +314,8 @@ const plugins: JupyterFrontEndPlugin<unknown>[] = [
291314 executionIndicator ,
292315 kernelStatus ,
293316 notebookFactoryPlugin ,
294- codemirrorYjsPlugin
317+ codemirrorYjsPlugin ,
318+ backupCellExecutorPlugin
295319] ;
296320
297321export default plugins ;
0 commit comments