mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-01 04:37:56 +01:00
re #114583.
This commit is contained in:
@@ -578,9 +578,37 @@ registerAction2(class extends NotebookAction {
|
||||
super({
|
||||
id: CANCEL_NOTEBOOK_COMMAND_ID,
|
||||
title: localize('notebookActions.cancelNotebook', "Cancel Notebook Execution"),
|
||||
description: {
|
||||
description: localize('notebookActions.executeNotebook', "Execute Notebook"),
|
||||
args: [
|
||||
{
|
||||
name: 'uri',
|
||||
description: 'The document uri',
|
||||
constraint: URI
|
||||
}
|
||||
]
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getEditorContextFromArgsOrActive(accessor: ServicesAccessor, context?: UriComponents): INotebookActionContext | undefined {
|
||||
if (context) {
|
||||
const uri = URI.revive(context);
|
||||
|
||||
if (uri) {
|
||||
const widget = getWidgetFromUri(accessor, uri);
|
||||
|
||||
if (widget) {
|
||||
return {
|
||||
notebookEditor: widget,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async runWithContext(accessor: ServicesAccessor, context: INotebookActionContext): Promise<void> {
|
||||
return context.notebookEditor.cancelNotebookExecution();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user