@@ -51,7 +51,6 @@ import { IInteractiveDocumentService, InteractiveDocumentService } from 'vs/work
51
51
import { InteractiveEditor } from 'vs/workbench/contrib/interactive/browser/interactiveEditor' ;
52
52
import { InteractiveEditorInput } from 'vs/workbench/contrib/interactive/browser/interactiveEditorInput' ;
53
53
import { IInteractiveHistoryService , InteractiveHistoryService } from 'vs/workbench/contrib/interactive/browser/interactiveHistoryService' ;
54
- import { InteractiveWindowFileSystem } from 'vs/workbench/contrib/interactive/browser/interactiveWindowFileSystem' ;
55
54
import { NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT } from 'vs/workbench/contrib/notebook/browser/controller/coreActions' ;
56
55
import { INotebookEditorOptions } from 'vs/workbench/contrib/notebook/browser/notebookBrowser' ;
57
56
import { NotebookEditorWidget } from 'vs/workbench/contrib/notebook/browser/notebookEditorWidget' ;
@@ -96,9 +95,6 @@ export class InteractiveDocumentContribution extends Disposable implements IWork
96
95
cellContentMetadata : { }
97
96
} ;
98
97
99
- const interactiveWindowFS = new InteractiveWindowFileSystem ( ) ;
100
- this . _register ( fileService . registerProvider ( Schemas . vscodeInteractive , interactiveWindowFS ) ) ;
101
-
102
98
const serializer : INotebookSerializer = {
103
99
options : contentOptions ,
104
100
dataToNotebook : async ( data : VSBuffer ) : Promise < NotebookData > => {
@@ -205,7 +201,9 @@ export class InteractiveDocumentContribution extends Disposable implements IWork
205
201
priority : RegisteredEditorPriority . exclusive
206
202
} ,
207
203
{
208
- canSupportResource : uri => uri . scheme === Schemas . vscodeInteractive || ( uri . scheme === Schemas . vscodeNotebookCell && extname ( uri ) === '.interactive' ) ,
204
+ canSupportResource : uri =>
205
+ ( uri . scheme === Schemas . untitled && extname ( uri ) === '.interactive' ) ||
206
+ ( uri . scheme === Schemas . vscodeNotebookCell && extname ( uri ) === '.interactive' ) ,
209
207
singlePerResource : true
210
208
} ,
211
209
{
@@ -371,7 +369,7 @@ registerAction2(class extends Action2 {
371
369
preserveFocus : typeof showOptions !== 'number' ? ( showOptions ?. preserveFocus ?? false ) : false
372
370
} ;
373
371
374
- if ( resource && resource . scheme === Schemas . vscodeInteractive ) {
372
+ if ( resource && extname ( resource ) === '.interactive' ) {
375
373
logService . debug ( 'Open interactive window from resource:' , resource . toString ( ) ) ;
376
374
const resourceUri = URI . revive ( resource ) ;
377
375
const editors = editorService . findEditors ( resourceUri ) . filter ( id => id . editor instanceof InteractiveEditorInput && id . editor . resource ?. toString ( ) === resourceUri . toString ( ) ) ;
@@ -401,7 +399,7 @@ registerAction2(class extends Action2 {
401
399
let inputUri : URI | undefined = undefined ;
402
400
let counter = 1 ;
403
401
do {
404
- notebookUri = URI . from ( { scheme : Schemas . vscodeInteractive , path : `/Interactive-${ counter } .interactive` } ) ;
402
+ notebookUri = URI . from ( { scheme : Schemas . untitled , path : `/Interactive-${ counter } .interactive` } ) ;
405
403
inputUri = URI . from ( { scheme : Schemas . vscodeInteractiveInput , path : `/InteractiveInput-${ counter } ` } ) ;
406
404
407
405
counter ++ ;
@@ -435,7 +433,7 @@ registerAction2(class extends Action2 {
435
433
category : interactiveWindowCategory ,
436
434
keybinding : {
437
435
// when: NOTEBOOK_CELL_LIST_FOCUSED,
438
- when : ContextKeyExpr . equals ( 'resourceScheme ' , Schemas . vscodeInteractive ) ,
436
+ when : ContextKeyExpr . equals ( 'activeEditor ' , 'workbench.editor.interactive' ) ,
439
437
primary : KeyMod . WinCtrl | KeyCode . Enter ,
440
438
win : {
441
439
primary : KeyMod . CtrlCmd | KeyCode . Enter
@@ -469,15 +467,14 @@ registerAction2(class extends Action2 {
469
467
const notebookEditorService = accessor . get ( INotebookEditorService ) ;
470
468
let editorControl : { notebookEditor : NotebookEditorWidget | undefined ; codeEditor : CodeEditorWidget } | undefined ;
471
469
if ( context ) {
472
- if ( context . scheme === Schemas . vscodeInteractive ) {
473
- const resourceUri = URI . revive ( context ) ;
474
- const editors = editorService . findEditors ( resourceUri ) . filter ( id => id . editor instanceof InteractiveEditorInput && id . editor . resource ?. toString ( ) === resourceUri . toString ( ) ) ;
475
- if ( editors . length ) {
476
- const editorInput = editors [ 0 ] . editor as InteractiveEditorInput ;
477
- const currentGroup = editors [ 0 ] . groupId ;
478
- const editor = await editorService . openEditor ( editorInput , currentGroup ) ;
479
- editorControl = editor ?. getControl ( ) as { notebookEditor : NotebookEditorWidget | undefined ; codeEditor : CodeEditorWidget } | undefined ;
480
- }
470
+ const resourceUri = URI . revive ( context ) ;
471
+ const editors = editorService . findEditors ( resourceUri )
472
+ . filter ( id => id . editor instanceof InteractiveEditorInput && id . editor . resource ?. toString ( ) === resourceUri . toString ( ) ) ;
473
+ if ( editors . length ) {
474
+ const editorInput = editors [ 0 ] . editor as InteractiveEditorInput ;
475
+ const currentGroup = editors [ 0 ] . groupId ;
476
+ const editor = await editorService . openEditor ( editorInput , currentGroup ) ;
477
+ editorControl = editor ?. getControl ( ) as { notebookEditor : NotebookEditorWidget | undefined ; codeEditor : CodeEditorWidget } | undefined ;
481
478
}
482
479
}
483
480
else {
@@ -578,7 +575,7 @@ registerAction2(class extends Action2 {
578
575
f1 : false ,
579
576
keybinding : {
580
577
when : ContextKeyExpr . and (
581
- ContextKeyExpr . equals ( 'resourceScheme ' , Schemas . vscodeInteractive ) ,
578
+ ContextKeyExpr . equals ( 'activeEditor ' , 'workbench.editor.interactive' ) ,
582
579
INTERACTIVE_INPUT_CURSOR_BOUNDARY . notEqualsTo ( 'bottom' ) ,
583
580
INTERACTIVE_INPUT_CURSOR_BOUNDARY . notEqualsTo ( 'none' ) ,
584
581
SuggestContext . Visible . toNegated ( )
@@ -617,7 +614,7 @@ registerAction2(class extends Action2 {
617
614
f1 : false ,
618
615
keybinding : {
619
616
when : ContextKeyExpr . and (
620
- ContextKeyExpr . equals ( 'resourceScheme ' , Schemas . vscodeInteractive ) ,
617
+ ContextKeyExpr . equals ( 'activeEditor ' , 'workbench.editor.interactive' ) ,
621
618
INTERACTIVE_INPUT_CURSOR_BOUNDARY . notEqualsTo ( 'top' ) ,
622
619
INTERACTIVE_INPUT_CURSOR_BOUNDARY . notEqualsTo ( 'none' ) ,
623
620
SuggestContext . Visible . toNegated ( )
@@ -654,7 +651,7 @@ registerAction2(class extends Action2 {
654
651
id : 'interactive.scrollToTop' ,
655
652
title : localize ( 'interactiveScrollToTop' , 'Scroll to Top' ) ,
656
653
keybinding : {
657
- when : ContextKeyExpr . equals ( 'resourceScheme ' , Schemas . vscodeInteractive ) ,
654
+ when : ContextKeyExpr . equals ( 'activeEditor ' , 'workbench.editor.interactive' ) ,
658
655
primary : KeyMod . CtrlCmd | KeyCode . Home ,
659
656
mac : { primary : KeyMod . CtrlCmd | KeyCode . UpArrow } ,
660
657
weight : KeybindingWeight . WorkbenchContrib
@@ -683,7 +680,7 @@ registerAction2(class extends Action2 {
683
680
id : 'interactive.scrollToBottom' ,
684
681
title : localize ( 'interactiveScrollToBottom' , 'Scroll to Bottom' ) ,
685
682
keybinding : {
686
- when : ContextKeyExpr . equals ( 'resourceScheme ' , Schemas . vscodeInteractive ) ,
683
+ when : ContextKeyExpr . equals ( 'activeEditor ' , 'workbench.editor.interactive' ) ,
687
684
primary : KeyMod . CtrlCmd | KeyCode . End ,
688
685
mac : { primary : KeyMod . CtrlCmd | KeyCode . DownArrow } ,
689
686
weight : KeybindingWeight . WorkbenchContrib
@@ -750,9 +747,9 @@ registerAction2(class extends Action2 {
750
747
category : interactiveWindowCategory ,
751
748
menu : {
752
749
id : MenuId . CommandPalette ,
753
- when : ContextKeyExpr . equals ( 'resourceScheme ' , Schemas . vscodeInteractive ) ,
750
+ when : ContextKeyExpr . equals ( 'activeEditor ' , 'workbench.editor.interactive' ) ,
754
751
} ,
755
- precondition : ContextKeyExpr . equals ( 'resourceScheme ' , Schemas . vscodeInteractive ) ,
752
+ precondition : ContextKeyExpr . equals ( 'activeEditor ' , 'workbench.editor.interactive' ) ,
756
753
} ) ;
757
754
}
758
755
0 commit comments