@@ -263,6 +263,27 @@ declare module 'vscode' {
263263 delete ( index : number ) : void ;
264264 }
265265
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+
266287 export interface NotebookEditor {
267288 /**
268289 * The document associated with this notebook editor.
@@ -274,6 +295,12 @@ declare module 'vscode' {
274295 */
275296 readonly selection ?: NotebookCell ;
276297
298+
299+ /**
300+ * The current visible ranges in the editor (vertically).
301+ */
302+ readonly visibleRanges : NotebookCellRange [ ] ;
303+
277304 /**
278305 * The column in which this editor shows.
279306 */
@@ -318,6 +345,8 @@ declare module 'vscode' {
318345 asWebviewUri ( localResource : Uri ) : Uri ;
319346
320347 edit ( callback : ( editBuilder : NotebookEditorCellEdit ) => void ) : Thenable < boolean > ;
348+
349+ revealRange ( range : NotebookCellRange , revealType ?: NotebookEditorRevealType ) : void ;
321350 }
322351
323352 export interface NotebookOutputSelector {
@@ -380,6 +409,16 @@ declare module 'vscode' {
380409 readonly cell : NotebookCell ;
381410 }
382411
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+
383422 export interface NotebookCellData {
384423 readonly cellKind : CellKind ;
385424 readonly source : string ;
@@ -509,6 +548,7 @@ declare module 'vscode' {
509548 readonly id ?: string ;
510549 label : string ;
511550 description ?: string ;
551+ detail ?: string ;
512552 isPreferred ?: boolean ;
513553 preloads ?: Uri [ ] ;
514554 executeCell ( document : NotebookDocument , cell : NotebookCell ) : void ;
@@ -518,13 +558,12 @@ declare module 'vscode' {
518558 }
519559
520560 export interface NotebookDocumentFilter {
521- viewType ?: string ;
522- filenamePattern ?: GlobPattern ;
523- excludeFileNamePattern ?: GlobPattern ;
561+ viewType ?: string | string [ ] ;
562+ filenamePattern ?: GlobPattern | { include : GlobPattern ; exclude : GlobPattern } ;
524563 }
525564
526565 export interface NotebookKernelProvider < T extends NotebookKernel = NotebookKernel > {
527- onDidChangeKernels ?: Event < void > ;
566+ onDidChangeKernels ?: Event < NotebookDocument | undefined > ;
528567 provideKernels ( document : NotebookDocument , token : CancellationToken ) : ProviderResult < T [ ] > ;
529568 resolveKernel ?( kernel : T , document : NotebookDocument , webview : NotebookCommunication , token : CancellationToken ) : ProviderResult < void > ;
530569 }
@@ -581,12 +620,6 @@ declare module 'vscode' {
581620 provider : NotebookKernelProvider
582621 ) : Disposable ;
583622
584- export function registerNotebookKernel (
585- id : string ,
586- selectors : GlobPattern [ ] ,
587- kernel : NotebookKernel
588- ) : Disposable ;
589-
590623 export const onDidOpenNotebookDocument : Event < NotebookDocument > ;
591624 export const onDidCloseNotebookDocument : Event < NotebookDocument > ;
592625 export const onDidSaveNotebookDocument : Event < NotebookDocument > ;
@@ -596,11 +629,13 @@ declare module 'vscode' {
596629 */
597630 export const notebookDocuments : ReadonlyArray < NotebookDocument > ;
598631
599- export let visibleNotebookEditors : NotebookEditor [ ] ;
632+ export const visibleNotebookEditors : NotebookEditor [ ] ;
600633 export const onDidChangeVisibleNotebookEditors : Event < NotebookEditor [ ] > ;
601634
602- export let activeNotebookEditor : NotebookEditor | undefined ;
635+ export const activeNotebookEditor : NotebookEditor | undefined ;
603636 export const onDidChangeActiveNotebookEditor : Event < NotebookEditor | undefined > ;
637+ export const onDidChangeNotebookEditorSelection : Event < NotebookEditorSelectionChangeEvent > ;
638+ export const onDidChangeNotebookEditorVisibleRanges : Event < NotebookEditorVisibleRangesChangeEvent > ;
604639 export const onDidChangeNotebookCells : Event < NotebookCellsChangeEvent > ;
605640 export const onDidChangeCellOutputs : Event < NotebookCellOutputsChangeEvent > ;
606641 export const onDidChangeCellLanguage : Event < NotebookCellLanguageChangeEvent > ;
0 commit comments