From 885d50ecab831ab11f89fa628d1e70d1e9c042c1 Mon Sep 17 00:00:00 2001 From: Vincent Fugnitto Date: Mon, 19 Dec 2022 08:58:54 -0500 Subject: [PATCH] plugin: fix `notebook` stubs (#12003) The commit fixes some stubs from the `notebook` API which prevented extensions from activating and producing errors. Signed-off-by: vince-fugnitto --- packages/plugin-ext/src/plugin/plugin-context.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/plugin-ext/src/plugin/plugin-context.ts b/packages/plugin-ext/src/plugin/plugin-context.ts index a621ff8896521..260aaf08ac1d3 100644 --- a/packages/plugin-ext/src/plugin/plugin-context.ts +++ b/packages/plugin-ext/src/plugin/plugin-context.ts @@ -1075,7 +1075,7 @@ export function createAPIFactory( notebook: theia.NotebookDocument, controller: theia.NotebookController ): (void | Thenable) { }, - onDidChangeSelectedNotebooks: ({} as theia.Event<{ readonly notebook: theia.NotebookDocument; readonly selected: boolean }>), + onDidChangeSelectedNotebooks: () => Disposable.create(() => {}), updateNotebookAffinity: (notebook: theia.NotebookDocument, affinity: theia.NotebookControllerAffinity) => undefined, dispose: () => undefined, }; @@ -1086,8 +1086,8 @@ export function createAPIFactory( ) { return { rendererId, - onDidReceiveMessage: ({} as theia.Event<{ readonly editor: theia.NotebookEditor; readonly message: any }>), - postMessage: (message: any, editor?: theia.NotebookEditor) => ({} as Thenable), + onDidReceiveMessage: () => Disposable.create(() => {} ), + postMessage: () => Promise.resolve({}), }; }, registerNotebookCellStatusBarItemProvider(