@@ -31,6 +31,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
31
31
import { registerSingleton } from 'vs/platform/instantiation/common/extensions' ;
32
32
import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
33
33
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
34
+ import { ILogService } from 'vs/platform/log/common/log' ;
34
35
import { Registry } from 'vs/platform/registry/common/platform' ;
35
36
import { contrastBorder , listInactiveSelectionBackground , registerColor , transparent } from 'vs/platform/theme/common/colorRegistry' ;
36
37
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService' ;
@@ -344,16 +345,19 @@ registerAction2(class extends Action2 {
344
345
const editorGroupService = accessor . get ( IEditorGroupsService ) ;
345
346
const historyService = accessor . get ( IInteractiveHistoryService ) ;
346
347
const kernelService = accessor . get ( INotebookKernelService ) ;
348
+ const logService = accessor . get ( ILogService ) ;
347
349
const group = columnToEditorGroup ( editorGroupService , typeof showOptions === 'number' ? showOptions : showOptions ?. viewColumn ) ;
348
350
const editorOptions = {
349
351
activation : EditorActivation . PRESERVE ,
350
352
preserveFocus : typeof showOptions !== 'number' ? ( showOptions ?. preserveFocus ?? false ) : false
351
353
} ;
352
354
353
355
if ( resource && resource . scheme === Schemas . vscodeInteractive ) {
356
+ logService . debug ( 'Open interactive window from resource:' , resource . toString ( ) ) ;
354
357
const resourceUri = URI . revive ( resource ) ;
355
358
const editors = editorService . findEditors ( resourceUri ) . filter ( id => id . editor instanceof InteractiveEditorInput && id . editor . resource ?. toString ( ) === resourceUri . toString ( ) ) ;
356
359
if ( editors . length ) {
360
+ logService . debug ( 'Find existing interactive window:' , resource . toString ( ) ) ;
357
361
const editorInput = editors [ 0 ] . editor as InteractiveEditorInput ;
358
362
const currentGroup = editors [ 0 ] . groupId ;
359
363
const editor = await editorService . openEditor ( editorInput , editorOptions , currentGroup ) ;
@@ -384,6 +388,8 @@ registerAction2(class extends Action2 {
384
388
counter ++ ;
385
389
} while ( existingNotebookDocument . has ( notebookUri . toString ( ) ) ) ;
386
390
391
+ logService . debug ( 'Open new interactive window:' , notebookUri . toString ( ) , inputUri . toString ( ) ) ;
392
+
387
393
if ( id ) {
388
394
const allKernels = kernelService . getMatchingKernel ( { uri : notebookUri , viewType : 'interactive' } ) . all ;
389
395
const preferredKernel = allKernels . find ( kernel => kernel . id === id ) ;
@@ -397,6 +403,7 @@ registerAction2(class extends Action2 {
397
403
const editorPane = await editorService . openEditor ( editorInput , editorOptions , group ) ;
398
404
const editorControl = editorPane ?. getControl ( ) as { notebookEditor : NotebookEditorWidget | undefined ; codeEditor : CodeEditorWidget } | undefined ;
399
405
// 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 ( ) ) ;
400
407
return { notebookUri, inputUri, notebookEditorId : editorControl ?. notebookEditor ?. getId ( ) } ;
401
408
}
402
409
} ) ;
0 commit comments