@@ -263,6 +263,27 @@ declare module 'vscode' {
263
263
delete ( index : number ) : void ;
264
264
}
265
265
266
+ export interface NotebookCellRange {
267
+ readonly start : number ;
268
+ readonly end : number ;
269
+ }
270
+
271
+ export enum NotebookEditorRevealType {
272
+ /**
273
+ * The range will be revealed with as little scrolling as possible.
274
+ */
275
+ Default = 0 ,
276
+ /**
277
+ * The range will always be revealed in the center of the viewport.
278
+ */
279
+ InCenter = 1 ,
280
+ /**
281
+ * If the range is outside the viewport, it will be revealed in the center of the viewport.
282
+ * Otherwise, it will be revealed with as little scrolling as possible.
283
+ */
284
+ InCenterIfOutsideViewport = 2 ,
285
+ }
286
+
266
287
export interface NotebookEditor {
267
288
/**
268
289
* The document associated with this notebook editor.
@@ -274,6 +295,12 @@ declare module 'vscode' {
274
295
*/
275
296
readonly selection ?: NotebookCell ;
276
297
298
+
299
+ /**
300
+ * The current visible ranges in the editor (vertically).
301
+ */
302
+ readonly visibleRanges : NotebookCellRange [ ] ;
303
+
277
304
/**
278
305
* The column in which this editor shows.
279
306
*/
@@ -318,6 +345,8 @@ declare module 'vscode' {
318
345
asWebviewUri ( localResource : Uri ) : Uri ;
319
346
320
347
edit ( callback : ( editBuilder : NotebookEditorCellEdit ) => void ) : Thenable < boolean > ;
348
+
349
+ revealRange ( range : NotebookCellRange , revealType ?: NotebookEditorRevealType ) : void ;
321
350
}
322
351
323
352
export interface NotebookOutputSelector {
@@ -380,6 +409,16 @@ declare module 'vscode' {
380
409
readonly cell : NotebookCell ;
381
410
}
382
411
412
+ export interface NotebookEditorSelectionChangeEvent {
413
+ readonly notebookEditor : NotebookEditor ;
414
+ readonly selection ?: NotebookCell ;
415
+ }
416
+
417
+ export interface NotebookEditorVisibleRangesChangeEvent {
418
+ readonly notebookEditor : NotebookEditor ;
419
+ readonly visibleRanges : ReadonlyArray < NotebookCellRange > ;
420
+ }
421
+
383
422
export interface NotebookCellData {
384
423
readonly cellKind : CellKind ;
385
424
readonly source : string ;
@@ -509,6 +548,7 @@ declare module 'vscode' {
509
548
readonly id ?: string ;
510
549
label : string ;
511
550
description ?: string ;
551
+ detail ?: string ;
512
552
isPreferred ?: boolean ;
513
553
preloads ?: Uri [ ] ;
514
554
executeCell ( document : NotebookDocument , cell : NotebookCell ) : void ;
@@ -518,13 +558,12 @@ declare module 'vscode' {
518
558
}
519
559
520
560
export interface NotebookDocumentFilter {
521
- viewType ?: string ;
522
- filenamePattern ?: GlobPattern ;
523
- excludeFileNamePattern ?: GlobPattern ;
561
+ viewType ?: string | string [ ] ;
562
+ filenamePattern ?: GlobPattern | { include : GlobPattern ; exclude : GlobPattern } ;
524
563
}
525
564
526
565
export interface NotebookKernelProvider < T extends NotebookKernel = NotebookKernel > {
527
- onDidChangeKernels ?: Event < void > ;
566
+ onDidChangeKernels ?: Event < NotebookDocument | undefined > ;
528
567
provideKernels ( document : NotebookDocument , token : CancellationToken ) : ProviderResult < T [ ] > ;
529
568
resolveKernel ?( kernel : T , document : NotebookDocument , webview : NotebookCommunication , token : CancellationToken ) : ProviderResult < void > ;
530
569
}
@@ -581,12 +620,6 @@ declare module 'vscode' {
581
620
provider : NotebookKernelProvider
582
621
) : Disposable ;
583
622
584
- export function registerNotebookKernel (
585
- id : string ,
586
- selectors : GlobPattern [ ] ,
587
- kernel : NotebookKernel
588
- ) : Disposable ;
589
-
590
623
export const onDidOpenNotebookDocument : Event < NotebookDocument > ;
591
624
export const onDidCloseNotebookDocument : Event < NotebookDocument > ;
592
625
export const onDidSaveNotebookDocument : Event < NotebookDocument > ;
@@ -596,11 +629,13 @@ declare module 'vscode' {
596
629
*/
597
630
export const notebookDocuments : ReadonlyArray < NotebookDocument > ;
598
631
599
- export let visibleNotebookEditors : NotebookEditor [ ] ;
632
+ export const visibleNotebookEditors : NotebookEditor [ ] ;
600
633
export const onDidChangeVisibleNotebookEditors : Event < NotebookEditor [ ] > ;
601
634
602
- export let activeNotebookEditor : NotebookEditor | undefined ;
635
+ export const activeNotebookEditor : NotebookEditor | undefined ;
603
636
export const onDidChangeActiveNotebookEditor : Event < NotebookEditor | undefined > ;
637
+ export const onDidChangeNotebookEditorSelection : Event < NotebookEditorSelectionChangeEvent > ;
638
+ export const onDidChangeNotebookEditorVisibleRanges : Event < NotebookEditorVisibleRangesChangeEvent > ;
604
639
export const onDidChangeNotebookCells : Event < NotebookCellsChangeEvent > ;
605
640
export const onDidChangeCellOutputs : Event < NotebookCellOutputsChangeEvent > ;
606
641
export const onDidChangeCellLanguage : Event < NotebookCellLanguageChangeEvent > ;
0 commit comments