Skip to content

Commit

Permalink
enable with hidden setting
Browse files Browse the repository at this point in the history
  • Loading branch information
amunger committed Nov 16, 2023
1 parent d6e8573 commit d5d2456
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,28 @@ import { NotebookVariablesView } from 'vs/workbench/contrib/notebook/browser/con
import { NOTEBOOK_KERNEL } from 'vs/workbench/contrib/notebook/common/notebookContextKeys';
import { variablesViewIcon } from 'vs/workbench/contrib/notebook/browser/notebookIcons';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';


export class NotebookVariables extends Disposable implements IWorkbenchContribution {
private listener: IDisposable;

constructor(
@IEditorService private readonly editorService: IEditorService
@IEditorService private readonly editorService: IEditorService,
@IConfigurationService configurationService: IConfigurationService
) {
super();
this.initializeView();

this.listener = this.editorService.onDidEditorsChange(() => {
if (this.editorService.activeEditorPane?.getId() === 'workbench.editor.notebook') {
if (configurationService.getValue('notebook.experimental.kernelVariableView')
&& this.editorService.activeEditorPane?.getId() === 'workbench.editor.notebook') {
this.listener.dispose();
this.initializeView();
}
});
}

private async initializeView() {

const debugViewContainer = Registry.as<IViewContainersRegistry>('workbench.registry.view.containers').get(debugContainerId);

if (debugViewContainer) {
Expand All @@ -47,7 +48,5 @@ export class NotebookVariables extends Disposable implements IWorkbenchContribut

viewsRegistry.registerViews([viewDescriptor], debugViewContainer);
}

}

}

0 comments on commit d5d2456

Please sign in to comment.