diff --git a/package.json b/package.json index c44d0af2c47..96946ad7c30 100644 --- a/package.json +++ b/package.json @@ -636,18 +636,6 @@ "category": "Notebook", "enablement": "!jupyter.webExtension" }, - { - "command": "jupyter.notebookeditor.expandallcells", - "title": "%jupyter.command.jupyter.notebookeditor.expandallcells.title%", - "category": "Notebook", - "enablement": "!jupyter.webExtension" - }, - { - "command": "jupyter.notebookeditor.collapseallcells", - "title": "%jupyter.command.jupyter.notebookeditor.collapseallcells.title%", - "category": "Notebook", - "enablement": "!jupyter.webExtension" - }, { "command": "jupyter.expandallcells", "title": "%jupyter.command.jupyter.expandallcells.title%", @@ -1293,18 +1281,6 @@ "category": "Notebook", "when": "jupyter.isnativeactive && isWorkspaceTrusted" }, - { - "command": "jupyter.notebookeditor.expandallcells", - "title": "%jupyter.command.jupyter.expandallcells.title%", - "category": "Notebook", - "when": "notebookEditorFocused && notebookType == 'jupyter-notebook'" - }, - { - "command": "jupyter.notebookeditor.collapseallcells", - "title": "%jupyter.command.jupyter.collapseallcells.title%", - "category": "Notebook", - "when": "notebookEditorFocused && notebookType == 'jupyter-notebook'" - }, { "command": "jupyter.expandallcells", "title": "%jupyter.command.jupyter.expandallcells.title%", diff --git a/package.nls.json b/package.nls.json index 6c73a7d5e07..dd12ebc5e8a 100644 --- a/package.nls.json +++ b/package.nls.json @@ -49,14 +49,6 @@ "jupyter.command.jupyter.runFileInteractive.title": "Run Current File in Interactive Window", "jupyter.command.jupyter.debugFileInteractive.title": "Debug Current File in Interactive Window", "jupyter.command.jupyter.runallcells.title": "Run All Cells", - "jupyter.command.jupyter.notebookeditor.expandallcells.title": { - "message": "Expand All Notebook Cells", - "comment": ["{Locked='Notebook'}"] - }, - "jupyter.command.jupyter.notebookeditor.collapseallcells.title": { - "message": "Collapse All Notebook Cells", - "comment": ["{Locked='Notebook'}"] - }, "jupyter.command.jupyter.runallcellsabove.title": "Run Above", "jupyter.command.jupyter.runcellandallbelow.title": "Run Below", "jupyter.command.jupyter.runallcellsabove.palette.title": "Run Cells Above Current Cell", diff --git a/src/commands.ts b/src/commands.ts index 96778cbe131..f72fbb967ea 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -177,8 +177,6 @@ export interface ICommandNameArgumentTypeMapping { [DSCommands.NativeNotebookExport]: [Uri | undefined | { notebookEditor: { notebookUri: Uri } }]; [DSCommands.LatestExtension]: [string]; [DSCommands.EnableLoadingWidgetsFrom3rdPartySource]: []; - [DSCommands.NotebookEditorExpandAllCells]: []; - [DSCommands.NotebookEditorCollapseAllCells]: []; [DSCommands.ShowDataViewer]: [IJupyterVariable | IShowDataViewerFromVariablePanel]; [DSCommands.RefreshDataViewer]: []; [DSCommands.ClearSavedJupyterUris]: []; diff --git a/src/notebooks/notebookCommandListener.ts b/src/notebooks/notebookCommandListener.ts index ce78a9acc0b..15a477106fb 100644 --- a/src/notebooks/notebookCommandListener.ts +++ b/src/notebooks/notebookCommandListener.ts @@ -59,12 +59,6 @@ export class NotebookCommandListener implements IDataScienceCommandListener { this.disposableRegistry.push( commands.registerCommand(Commands.NotebookEditorAddCellBelow, () => this.addCellBelow()) ); - this.disposableRegistry.push( - commands.registerCommand(Commands.NotebookEditorCollapseAllCells, () => this.collapseAll()) - ); - this.disposableRegistry.push( - commands.registerCommand(Commands.NotebookEditorExpandAllCells, () => this.expandAll()) - ); this.disposableRegistry.push( // TODO: if contributed anywhere, add context support commands.registerCommand(Commands.RestartKernelAndRunUpToSelectedCell, () => @@ -128,34 +122,6 @@ export class NotebookCommandListener implements IDataScienceCommandListener { edit.set(document.uri, [nbEdit]); }).then(noop, noop); } - private collapseAll() { - const document = window.activeNotebookEditor?.notebook; - if (!document) { - return; - } - - chainWithPendingUpdates(document, (edit) => { - document.getCells().forEach((cell, index) => { - const metadata = { ...(cell.metadata || {}), inputCollapsed: true, outputCollapsed: true }; - edit.set(document.uri, [NotebookEdit.updateCellMetadata(index, metadata)]); - }); - }).then(noop, noop); - } - - private expandAll() { - const document = window.activeNotebookEditor?.notebook; - if (!document) { - return; - } - - chainWithPendingUpdates(document, (edit) => { - document.getCells().forEach((cell, index) => { - const metadata = { ...(cell.metadata || {}), inputCollapsed: false, outputCollapsed: true }; - edit.set(document.uri, [NotebookEdit.updateCellMetadata(index, metadata)]); - }); - }).then(noop, noop); - } - private async interruptKernel(notebookUri: Uri | undefined): Promise { const uri = notebookUri ?? this.notebookEditorProvider.activeNotebookEditor?.notebook.uri; const document = workspace.notebookDocuments.find((document) => document.uri.toString() === uri?.toString()); diff --git a/src/platform/common/constants.ts b/src/platform/common/constants.ts index 292acf0d32c..fe04fde1826 100644 --- a/src/platform/common/constants.ts +++ b/src/platform/common/constants.ts @@ -224,8 +224,6 @@ export namespace Commands { export const NativeNotebookExport = 'jupyter.notebookeditor.export'; export const LatestExtension = 'jupyter.latestExtension'; export const EnableLoadingWidgetsFrom3rdPartySource = 'jupyter.enableLoadingWidgetScriptsFromThirdPartySource'; - export const NotebookEditorExpandAllCells = 'jupyter.notebookeditor.expandallcells'; - export const NotebookEditorCollapseAllCells = 'jupyter.notebookeditor.collapseallcells'; export const EnableDebugLogging = 'jupyter.enableDebugLogging'; export const ResetLoggingLevel = 'jupyter.resetLoggingLevel'; export const ShowDataViewer = 'jupyter.showDataViewer';