mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 17:23:21 -05:00
Split notebookcell (#17185)
* Initial Split code * minor change * minor changes * Added split cell button to initActionBar, created split cell class to pss cell context. * added changes * fixed index * Split Cell Working in markdown mode * Fixed highlighting * Preserve the edit state * Added new icon and updated styles and cellToolbar component with new icon name. * Addressed PR * Addressed PR * Added back isEditMode flag * Moved split action to after edit toggle. * Fixed typo * Addressed PR * Addressed PR * Removed deletion of the cell * fixed the comments Co-authored-by: Hale Rankin <harankin@microsoft.com>
This commit is contained in:
@@ -18,7 +18,6 @@ import { INotebookService } from 'sql/workbench/services/notebook/browser/notebo
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { MoveDirection } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
|
||||
const moreActionsLabel = localize('moreActionsLabel', "More");
|
||||
|
||||
export class EditCellAction extends ToggleableAction {
|
||||
@@ -58,6 +57,29 @@ export class EditCellAction extends ToggleableAction {
|
||||
}
|
||||
}
|
||||
|
||||
export class SplitCellAction extends CellActionBase {
|
||||
public cellType: CellType;
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
cssClass: string,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@INotebookService private notebookService: INotebookService,
|
||||
) {
|
||||
super(id, label, cssClass, notificationService);
|
||||
this._cssClass = cssClass;
|
||||
this._tooltip = label;
|
||||
this._label = '';
|
||||
}
|
||||
doRun(context: CellContext): Promise<void> {
|
||||
let model = context.model;
|
||||
let index = model.cells.findIndex((cell) => cell.id === context.cell.id);
|
||||
context.model?.splitCell(context.cell.cellType, this.notebookService, index);
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
export class MoveCellAction extends CellActionBase {
|
||||
constructor(
|
||||
id: string,
|
||||
|
||||
Reference in New Issue
Block a user