@@ -3426,6 +3426,72 @@ declare module 'vscode' {
3426
3426
constructor(range: Range, newText: string);
3427
3427
}
3428
3428
3429
+ /**
3430
+ * A notebook edit represents edits that should be applied to the contents of a notebook.
3431
+ */
3432
+ export class NotebookEdit {
3433
+
3434
+ /**
3435
+ * Utility to create a edit that replaces cells in a notebook.
3436
+ *
3437
+ * @param range The range of cells to replace
3438
+ * @param newCells The new notebook cells.
3439
+ */
3440
+ static replaceCells(range: NotebookRange, newCells: NotebookCellData[]): NotebookEdit;
3441
+
3442
+ /**
3443
+ * Utility to create an edit that replaces cells in a notebook.
3444
+ *
3445
+ * @param index The index to insert cells at.
3446
+ * @param newCells The new notebook cells.
3447
+ */
3448
+ static insertCells(index: number, newCells: NotebookCellData[]): NotebookEdit;
3449
+
3450
+ /**
3451
+ * Utility to create an edit that deletes cells in a notebook.
3452
+ *
3453
+ * @param range The range of cells to delete.
3454
+ */
3455
+ static deleteCells(range: NotebookRange): NotebookEdit;
3456
+
3457
+ /**
3458
+ * Utility to create an edit that update a cell's metadata.
3459
+ *
3460
+ * @param index The index of the cell to update.
3461
+ * @param newCellMetadata The new metadata for the cell.
3462
+ */
3463
+ static updateCellMetadata(index: number, newCellMetadata: { [key: string]: any }): NotebookEdit;
3464
+
3465
+ /**
3466
+ * Utility to create an edit that updates the notebook's metadata.
3467
+ *
3468
+ * @param newNotebookMetadata The new metadata for the notebook.
3469
+ */
3470
+ static updateNotebookMetadata(newNotebookMetadata: { [key: string]: any }): NotebookEdit;
3471
+
3472
+ /**
3473
+ * Range of the cells being edited. May be empty.
3474
+ */
3475
+ range: NotebookRange;
3476
+
3477
+ /**
3478
+ * New cells being inserted. May be empty.
3479
+ */
3480
+ newCells: NotebookCellData[];
3481
+
3482
+ /**
3483
+ * Optional new metadata for the cells.
3484
+ */
3485
+ newCellMetadata?: { [key: string]: any };
3486
+
3487
+ /**
3488
+ * Optional new metadata for the notebook.
3489
+ */
3490
+ newNotebookMetadata?: { [key: string]: any };
3491
+
3492
+ constructor(range: NotebookRange, newCells: NotebookCellData[]);
3493
+ }
3494
+
3429
3495
/**
3430
3496
* Additional data for entries of a workspace edit. Supports to label entries and marks entries
3431
3497
* as needing confirmation by the user. The editor groups edits with equal labels into tree nodes,
@@ -3508,9 +3574,9 @@ declare module 'vscode' {
3508
3574
* Set (and replace) text edits for a resource.
3509
3575
*
3510
3576
* @param uri A resource identifier.
3511
- * @param edits An array of text edits.
3577
+ * @param edits An array of edits.
3512
3578
*/
3513
- set(uri: Uri, edits: TextEdit[]): void;
3579
+ set(uri: Uri, edits: TextEdit[] | NotebookEdit[] ): void;
3514
3580
3515
3581
/**
3516
3582
* Get the text edits for a resource.
0 commit comments