@@ -31,6 +31,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
3131import { registerSingleton } from 'vs/platform/instantiation/common/extensions' ;
3232import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
3333import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
34+ import { ILogService } from 'vs/platform/log/common/log' ;
3435import { Registry } from 'vs/platform/registry/common/platform' ;
3536import { contrastBorder , listInactiveSelectionBackground , registerColor , transparent } from 'vs/platform/theme/common/colorRegistry' ;
3637import { registerThemingParticipant } from 'vs/platform/theme/common/themeService' ;
@@ -344,16 +345,19 @@ registerAction2(class extends Action2 {
344345 const editorGroupService = accessor . get ( IEditorGroupsService ) ;
345346 const historyService = accessor . get ( IInteractiveHistoryService ) ;
346347 const kernelService = accessor . get ( INotebookKernelService ) ;
348+ const logService = accessor . get ( ILogService ) ;
347349 const group = columnToEditorGroup ( editorGroupService , typeof showOptions === 'number' ? showOptions : showOptions ?. viewColumn ) ;
348350 const editorOptions = {
349351 activation : EditorActivation . PRESERVE ,
350352 preserveFocus : typeof showOptions !== 'number' ? ( showOptions ?. preserveFocus ?? false ) : false
351353 } ;
352354
353355 if ( resource && resource . scheme === Schemas . vscodeInteractive ) {
356+ logService . debug ( 'Open interactive window from resource:' , resource . toString ( ) ) ;
354357 const resourceUri = URI . revive ( resource ) ;
355358 const editors = editorService . findEditors ( resourceUri ) . filter ( id => id . editor instanceof InteractiveEditorInput && id . editor . resource ?. toString ( ) === resourceUri . toString ( ) ) ;
356359 if ( editors . length ) {
360+ logService . debug ( 'Find existing interactive window:' , resource . toString ( ) ) ;
357361 const editorInput = editors [ 0 ] . editor as InteractiveEditorInput ;
358362 const currentGroup = editors [ 0 ] . groupId ;
359363 const editor = await editorService . openEditor ( editorInput , editorOptions , currentGroup ) ;
@@ -384,6 +388,8 @@ registerAction2(class extends Action2 {
384388 counter ++ ;
385389 } while ( existingNotebookDocument . has ( notebookUri . toString ( ) ) ) ;
386390
391+ logService . debug ( 'Open new interactive window:' , notebookUri . toString ( ) , inputUri . toString ( ) ) ;
392+
387393 if ( id ) {
388394 const allKernels = kernelService . getMatchingKernel ( { uri : notebookUri , viewType : 'interactive' } ) . all ;
389395 const preferredKernel = allKernels . find ( kernel => kernel . id === id ) ;
@@ -397,6 +403,7 @@ registerAction2(class extends Action2 {
397403 const editorPane = await editorService . openEditor ( editorInput , editorOptions , group ) ;
398404 const editorControl = editorPane ?. getControl ( ) as { notebookEditor : NotebookEditorWidget | undefined ; codeEditor : CodeEditorWidget } | undefined ;
399405 // Extensions must retain references to these URIs to manipulate the interactive editor
406+ logService . debug ( 'New interactive window opened. Notebook editor id' , editorControl ?. notebookEditor ?. getId ( ) ) ;
400407 return { notebookUri, inputUri, notebookEditorId : editorControl ?. notebookEditor ?. getId ( ) } ;
401408 }
402409} ) ;
0 commit comments