Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setting for bringing up the variable view #7314

Merged
merged 1 commit into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,12 @@
"description": "Enables the preview debugging experience. Set to true to enable the debugging mode button on native notebooks. Your selected kernel should also have ipykernel 6 installed in order to support debugging. Clicking the button will start a debugging session and will allow you to set and hit breakpoints.",
"scope": "application"
},
"jupyter.showVariableViewWhenDebugging": {
"type": "boolean",
"default": true,
"description": "Bring up the Variable View when starting a Run by Line session.",
"scope": "application"
},
"jupyter.logging.level": {
"type": "string",
"default": "debug",
Expand Down
2 changes: 2 additions & 0 deletions src/client/common/configSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export class JupyterSettings implements IWatchableJupyterSettings {
// Hidden settings not surfaced in package.json
public disableZMQSupport: boolean = false;
public verboseLogging: boolean = false;
public showVariableViewWhenDebugging: boolean = true;

public variableTooltipFields: IVariableTooltipFields = {
python: {
Tensor: ['shape', 'dtype', 'device']
Expand Down
1 change: 1 addition & 0 deletions src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export interface IJupyterSettings {
readonly interactiveWindowMode: InteractiveWindowMode;
readonly disableZMQSupport: boolean;
readonly variableTooltipFields: IVariableTooltipFields;
readonly showVariableViewWhenDebugging: boolean;
}

export interface IVariableTooltipFields {
Expand Down
8 changes: 5 additions & 3 deletions src/client/debugger/jupyter/debuggingManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from 'vscode';
import * as path from 'path';
import { IKernel, IKernelProvider } from '../../datascience/jupyter/kernels/types';
import { IDisposable, Product, ProductInstallStatus } from '../../common/types';
import { IConfigurationService, IDisposable, Product, ProductInstallStatus } from '../../common/types';
import { IKernelDebugAdapterConfig, KernelDebugAdapter, KernelDebugMode } from './kernelDebugAdapter';
import { INotebookProvider } from '../../datascience/types';
import { IExtensionSingleActivationService } from '../../activation/types';
Expand Down Expand Up @@ -97,7 +97,8 @@ export class DebuggingManager implements IExtensionSingleActivationService, IDeb
@inject(IApplicationShell) private readonly appShell: IApplicationShell,
@inject(IVSCodeNotebook) private readonly vscNotebook: IVSCodeNotebook,
@inject(IFileSystem) private fs: IFileSystem,
@inject(IPythonInstaller) private pythonInstaller: IPythonInstaller
@inject(IPythonInstaller) private pythonInstaller: IPythonInstaller,
@inject(IConfigurationService) private settings: IConfigurationService
) {
this.debuggingInProgress = new ContextKey(EditorContexts.DebuggingInProgress, this.commandManager);
this.runByLineInProgress = new ContextKey(EditorContexts.RunByLineInProgress, this.commandManager);
Expand Down Expand Up @@ -147,7 +148,8 @@ export class DebuggingManager implements IExtensionSingleActivationService, IDeb
notebook.session,
this.commandManager,
this.fs,
kernel
kernel,
this.settings
);
this.disposables.push(
adapter.onDidSendMessage((msg: DebugProtocolMessage) => {
Expand Down
10 changes: 7 additions & 3 deletions src/client/debugger/jupyter/kernelDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ICommandManager } from '../../common/application/types';
import { traceError, traceVerbose } from '../../common/logger';
import { IFileSystem } from '../../common/platform/types';
import { IKernelDebugAdapter } from '../types';
import { IDisposable } from '../../common/types';
import { IConfigurationService, IDisposable } from '../../common/types';
import { Commands, Identifiers } from '../../datascience/constants';
import { IKernel } from '../../datascience/jupyter/kernels/types';
import { sendTelemetryEvent } from '../../telemetry';
Expand Down Expand Up @@ -95,7 +95,8 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID
private readonly jupyterSession: IJupyterSession,
private commandManager: ICommandManager,
private fs: IFileSystem,
private readonly kernel: IKernel | undefined
private readonly kernel: IKernel | undefined,
private settings: IConfigurationService
) {
void this.dumpAllCells();

Expand Down Expand Up @@ -506,7 +507,10 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID
this.sendRequestToJupyterSession(message);

// Open variable view
await this.commandManager.executeCommand(Commands.OpenVariableView);
const settings = this.settings.getSettings();
if (settings.showVariableViewWhenDebugging) {
await this.commandManager.executeCommand(Commands.OpenVariableView);
}
}

// Run cell
Expand Down