mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
inline NotebookExecuteHandler
type
This commit is contained in:
parent
387e2f39eb
commit
f207b38307
10
.vscode/searches/api-todos.code-search
vendored
10
.vscode/searches/api-todos.code-search
vendored
|
@ -1,10 +0,0 @@
|
|||
# Query: //todo@API
|
||||
# Including: */vscode.d.ts
|
||||
# ContextLines: 1
|
||||
|
||||
1 result - 1 file
|
||||
|
||||
src/vs/vscode.d.ts:
|
||||
11804 */
|
||||
11805: //todo@API inline?
|
||||
11806 export interface NotebookExecuteHandler {
|
17
src/vs/vscode.d.ts
vendored
17
src/vs/vscode.d.ts
vendored
|
@ -11799,19 +11799,6 @@ declare module 'vscode' {
|
|||
transientDocumentMetadata?: { [key: string]: boolean | undefined };
|
||||
}
|
||||
|
||||
/**
|
||||
* A callback that is invoked by the editor whenever cell execution has been triggered.
|
||||
*/
|
||||
//todo@API inline?
|
||||
export interface NotebookExecuteHandler {
|
||||
/**
|
||||
* @param cells The notebook cells to execute.
|
||||
* @param notebook The notebook for which the execute handler is being called.
|
||||
* @param controller The controller that the handler is attached to
|
||||
*/
|
||||
(cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController): void | Thenable<void>
|
||||
}
|
||||
|
||||
/**
|
||||
* Notebook controller affinity for notebook documents.
|
||||
*
|
||||
|
@ -11913,7 +11900,7 @@ declare module 'vscode' {
|
|||
* The execute handler is invoked when the run gestures in the UI are selected, e.g Run Cell, Run All,
|
||||
* Run Selection etc. The execute handler is responsible for creating and managing {@link NotebookCellExecution execution}-objects.
|
||||
*/
|
||||
executeHandler: NotebookExecuteHandler;
|
||||
executeHandler: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>;
|
||||
|
||||
/**
|
||||
* Optional interrupt handler.
|
||||
|
@ -12151,7 +12138,7 @@ declare module 'vscode' {
|
|||
* @param label The label of the controller.
|
||||
* @param handler The execute-handler of the controller.
|
||||
*/
|
||||
export function createNotebookController(id: string, notebookType: string, label: string, handler?: NotebookExecuteHandler): NotebookController;
|
||||
export function createNotebookController(id: string, notebookType: string, label: string, handler?: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>): NotebookController;
|
||||
|
||||
/**
|
||||
* Register a {@link NotebookCellStatusBarItemProvider cell statusbar item provider} for the given notebook type.
|
||||
|
|
2
src/vs/vscode.proposed.d.ts
vendored
2
src/vs/vscode.proposed.d.ts
vendored
|
@ -1535,7 +1535,7 @@ declare module 'vscode' {
|
|||
|
||||
export namespace notebooks {
|
||||
|
||||
export function createNotebookController(id: string, viewType: string, label: string, handler?: NotebookExecuteHandler, rendererScripts?: NotebookRendererScript[]): NotebookController;
|
||||
export function createNotebookController(id: string, viewType: string, label: string, handler?: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>, rendererScripts?: NotebookRendererScript[]): NotebookController;
|
||||
|
||||
/**
|
||||
* Creates a new messaging instance used to communicate with a specific
|
||||
|
|
|
@ -1083,7 +1083,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
|||
|
||||
// namespace: notebook
|
||||
const notebooks: typeof vscode.notebooks = {
|
||||
createNotebookController(id: string, notebookType: string, label: string, handler?: vscode.NotebookExecuteHandler, rendererScripts?: vscode.NotebookRendererScript[]) {
|
||||
createNotebookController(id: string, notebookType: string, label: string, handler?, rendererScripts?: vscode.NotebookRendererScript[]) {
|
||||
return extHostNotebookKernels.createNotebookController(extension, id, notebookType, label, handler, extension.enableProposedApi ? rendererScripts : undefined);
|
||||
},
|
||||
registerNotebookCellStatusBarItemProvider: (notebookType: string, provider: vscode.NotebookCellStatusBarItemProvider) => {
|
||||
|
|
|
@ -48,7 +48,7 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape {
|
|||
this._proxy = _mainContext.getProxy(MainContext.MainThreadNotebookKernels);
|
||||
}
|
||||
|
||||
createNotebookController(extension: IExtensionDescription, id: string, viewType: string, label: string, handler?: vscode.NotebookExecuteHandler, preloads?: vscode.NotebookRendererScript[]): vscode.NotebookController {
|
||||
createNotebookController(extension: IExtensionDescription, id: string, viewType: string, label: string, handler?: (cells: vscode.NotebookCell[], notebook: vscode.NotebookDocument, controller: vscode.NotebookController) => void | Thenable<void>, preloads?: vscode.NotebookRendererScript[]): vscode.NotebookController {
|
||||
|
||||
for (let data of this._kernelData.values()) {
|
||||
if (data.controller.id === id && ExtensionIdentifier.equals(extension.identifier, data.extensionId)) {
|
||||
|
@ -80,7 +80,7 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape {
|
|||
};
|
||||
|
||||
//
|
||||
let _executeHandler: vscode.NotebookExecuteHandler = handler ?? _defaultExecutHandler;
|
||||
let _executeHandler = handler ?? _defaultExecutHandler;
|
||||
let _interruptHandler: ((this: vscode.NotebookController, notebook: vscode.NotebookDocument) => void | Thenable<void>) | undefined;
|
||||
|
||||
// todo@jrieken the selector needs to be massaged
|
||||
|
|
Loading…
Reference in a new issue