mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Enable expand/collapse cell commands to be called programmatically
See microsoft/vscode-jupyter#8477
This commit is contained in:
parent
3baa168461
commit
bad4294784
|
@ -344,6 +344,10 @@ registerAction2(class CollapseCellInputAction extends NotebookMultiCellAction {
|
|||
});
|
||||
}
|
||||
|
||||
override parseArgs(accessor: ServicesAccessor, ...args: any[]): INotebookCommandContext | undefined {
|
||||
return parseMultiCellExecutionArgs(accessor, ...args);
|
||||
}
|
||||
|
||||
async runWithContext(accessor: ServicesAccessor, context: INotebookCommandContext | INotebookCellToolbarActionContext): Promise<void> {
|
||||
if (context.ui) {
|
||||
context.cell.isInputCollapsed = true;
|
||||
|
@ -372,6 +376,10 @@ registerAction2(class ExpandCellInputAction extends NotebookMultiCellAction {
|
|||
});
|
||||
}
|
||||
|
||||
override parseArgs(accessor: ServicesAccessor, ...args: any[]): INotebookCommandContext | undefined {
|
||||
return parseMultiCellExecutionArgs(accessor, ...args);
|
||||
}
|
||||
|
||||
async runWithContext(accessor: ServicesAccessor, context: INotebookCommandContext | INotebookCellToolbarActionContext): Promise<void> {
|
||||
if (context.ui) {
|
||||
context.cell.isInputCollapsed = false;
|
||||
|
|
Loading…
Reference in a new issue