@@ -36,7 +36,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
36
36
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
37
37
import { INotificationService } from 'vs/platform/notification/common/notification' ;
38
38
import { BOTTOM_CELL_TOOLBAR_HEIGHT , CELL_BOTTOM_MARGIN , CELL_TOP_MARGIN , EDITOR_BOTTOM_PADDING , EDITOR_TOOLBAR_HEIGHT , EDITOR_TOP_PADDING } from 'vs/workbench/contrib/notebook/browser/constants' ;
39
- import { CancelCellAction , ExecuteCellAction , INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/contrib/coreActions' ;
39
+ import { CancelCellAction , DeleteCellAction , ExecuteCellAction , INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/contrib/coreActions' ;
40
40
import { BaseCellRenderTemplate , CellEditState , CodeCellRenderTemplate , EXPAND_CELL_CONTENT_COMMAND_ID , ICellViewModel , INotebookEditor , isCodeCellRenderTemplate , MarkdownCellRenderTemplate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser' ;
41
41
import { CellContextKeyManager } from 'vs/workbench/contrib/notebook/browser/view/renderers/cellContextKeys' ;
42
42
import { CellMenus } from 'vs/workbench/contrib/notebook/browser/view/renderers/cellMenus' ;
@@ -379,7 +379,12 @@ export class MarkdownCellRenderer extends AbstractCellRenderer implements IListR
379
379
const container = DOM . append ( rootContainer , DOM . $ ( '.cell-inner-container' ) ) ;
380
380
const disposables = new DisposableStore ( ) ;
381
381
const contextKeyService = disposables . add ( this . contextKeyServiceProvider ( container ) ) ;
382
- const toolbar = disposables . add ( this . createToolbar ( container , 'cell-title-toolbar' ) ) ;
382
+
383
+ const titleToolbarContainer = DOM . append ( container , $ ( '.cell-title-toolbar' ) ) ;
384
+ const toolbar = disposables . add ( this . createToolbar ( titleToolbarContainer ) ) ;
385
+ const deleteToolbar = disposables . add ( this . createToolbar ( titleToolbarContainer , 'cell-delete-toolbar' ) ) ;
386
+ deleteToolbar . setActions ( [ this . instantiationService . createInstance ( DeleteCellAction ) ] ) ;
387
+
383
388
const focusIndicatorLeft = DOM . append ( container , DOM . $ ( '.cell-focus-indicator.cell-focus-indicator-side.cell-focus-indicator-left' ) ) ;
384
389
385
390
const codeInnerContent = DOM . append ( container , $ ( '.cell.code' ) ) ;
@@ -644,14 +649,17 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
644
649
const contextKeyService = disposables . add ( this . contextKeyServiceProvider ( container ) ) ;
645
650
646
651
DOM . append ( container , $ ( '.cell-focus-indicator.cell-focus-indicator-top' ) ) ;
647
- const toolbar = disposables . add ( this . createToolbar ( container , 'cell-title-toolbar' ) ) ;
652
+ const titleToolbarContainer = DOM . append ( container , $ ( '.cell-title-toolbar' ) ) ;
653
+ const toolbar = disposables . add ( this . createToolbar ( titleToolbarContainer ) ) ;
654
+ const deleteToolbar = disposables . add ( this . createToolbar ( titleToolbarContainer , 'cell-delete-toolbar' ) ) ;
655
+ deleteToolbar . setActions ( [ this . instantiationService . createInstance ( DeleteCellAction ) ] ) ;
656
+
648
657
const focusIndicator = DOM . append ( container , DOM . $ ( '.cell-focus-indicator.cell-focus-indicator-side.cell-focus-indicator-left' ) ) ;
649
658
const dragHandle = DOM . append ( container , DOM . $ ( '.cell-drag-handle' ) ) ;
650
659
651
660
const cellContainer = DOM . append ( container , $ ( '.cell.code' ) ) ;
652
661
const runButtonContainer = DOM . append ( cellContainer , $ ( '.run-button-container' ) ) ;
653
- const runToolbar = this . createToolbar ( runButtonContainer ) ;
654
- disposables . add ( runToolbar ) ;
662
+ const runToolbar = disposables . add ( this . createToolbar ( runButtonContainer ) ) ;
655
663
656
664
const executionOrderLabel = DOM . append ( runButtonContainer , $ ( 'div.execution-count-label' ) ) ;
657
665
0 commit comments