Skip to content
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: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"theme": "dark"
},
"engines": {
"vscode": "^1.48.0"
"vscode": "^1.49.0"
},
"keywords": [
"python",
Expand Down Expand Up @@ -1670,7 +1670,7 @@
{
"command": "python.datascience.showDataViewer",
"group": "1_view",
"when": "debugProtocolVariableMenuContext == 'viewableInDataViewer'"
"when": "python.isDebuggerDataViewerExperimentEnabled && debugProtocolVariableMenuContext == 'viewableInDataViewer'"
}
]
},
Expand Down Expand Up @@ -2127,6 +2127,7 @@
"RunByLine - experiment",
"tryPylance",
"jediLSP",
"debuggerDataViewer",
"All"
]
},
Expand All @@ -2152,6 +2153,7 @@
"RunByLine - experiment",
"tryPylance",
"jediLSP",
"debuggerDataViewer",
"All"
]
},
Expand Down
5 changes: 5 additions & 0 deletions src/client/common/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.
import { IExtensionSingleActivationService } from '../activation/types';
import { IExperimentService, IFileDownloader, IHttpClient, IInterpreterPathService } from '../common/types';
import { DebuggerDataViewerExperimentEnabler } from '../datascience/data-viewing/debuggerDataViewerExperimentEnabler';
import { LiveShareApi } from '../datascience/liveshare/liveshare';
import { INotebookExecutionLogger } from '../datascience/types';
import { IServiceManager } from '../ioc/types';
Expand Down Expand Up @@ -218,5 +219,9 @@ export function registerTypes(serviceManager: IServiceManager) {
IExtensionSingleActivationService,
DebugSessionTelemetry
);
serviceManager.addSingleton<IExtensionSingleActivationService>(
IExtensionSingleActivationService,
DebuggerDataViewerExperimentEnabler
);
serviceManager.addSingleton<ICustomEditorService>(ICustomEditorService, CustomEditorService);
}
7 changes: 4 additions & 3 deletions src/client/datascience/commands/commandRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { IConfigurationService, IDisposable, IOutputChannel } from '../../common
import { DataScience } from '../../common/utils/localize';
import { noop } from '../../common/utils/misc';
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
import { EventName } from '../../telemetry/constants';
import { Commands, JUPYTER_OUTPUT_CHANNEL, Telemetry } from '../constants';
import { IDataViewerFactory } from '../data-viewing/types';
import { DataViewerChecker } from '../interactive-common/dataViewerChecker';
Expand Down Expand Up @@ -481,7 +482,7 @@ export class CommandRegistry implements IDisposable {
}

private async onVariablePanelShowDataViewerRequest(request: IShowDataViewerFromVariablePanel) {
sendTelemetryEvent(Telemetry.OpenDataViewerFromVariableWindowRequest);
sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST);
if (this.debugService.activeDebugSession) {
const jupyterVariable = convertDebugProtocolVariableToIJupyterVariable(
request.variable as DebugProtocol.Variable
Expand All @@ -495,10 +496,10 @@ export class CommandRegistry implements IDisposable {
if (columnSize && (await this.dataViewerChecker.isRequestedColumnSizeAllowed(columnSize))) {
const title: string = `${DataScience.dataExplorerTitle()} - ${jupyterVariable.name}`;
await this.dataViewerFactory.create(jupyterVariableDataProvider, title);
sendTelemetryEvent(Telemetry.OpenDataViewerFromVariableWindowSuccess);
sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS);
}
} catch (e) {
sendTelemetryEvent(Telemetry.OpenDataViewerFromVariableWindowError);
sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR, undefined, e);
traceError(e);
this.appShell.showErrorMessage(e.toString());
}
Expand Down
5 changes: 1 addition & 4 deletions src/client/datascience/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,7 @@ export enum Telemetry {
TrustAllNotebooks = 'DATASCIENCE.TRUST_ALL_NOTEBOOKS',
TrustNotebook = 'DATASCIENCE.TRUST_NOTEBOOK',
DoNotTrustNotebook = 'DATASCIENCE.DO_NOT_TRUST_NOTEBOOK',
NotebookTrustPromptShown = 'DATASCIENCE.NOTEBOOK_TRUST_PROMPT_SHOWN',
OpenDataViewerFromVariableWindowRequest = 'DATASCIENCE.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST',
OpenDataViewerFromVariableWindowError = 'DATASCIENCE.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR',
OpenDataViewerFromVariableWindowSuccess = 'DATASCIENCE.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS'
NotebookTrustPromptShown = 'DATASCIENCE.NOTEBOOK_TRUST_PROMPT_SHOWN'
}

export enum NativeKeyboardCommandTelemetry {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { inject, injectable } from 'inversify';
import { IExtensionSingleActivationService } from '../../activation/types';
import { ICommandManager } from '../../common/application/types';
import { ContextKey } from '../../common/contextKey';
import { traceError } from '../../common/logger';
import { IExperimentService } from '../../common/types';

@injectable()
export class DebuggerDataViewerExperimentEnabler implements IExtensionSingleActivationService {
constructor(
@inject(ICommandManager) private readonly commandManager: ICommandManager,
@inject(IExperimentService) private readonly experimentService: IExperimentService
) {}
public async activate() {
this.activateInternal().catch(traceError.bind('Failed to activate debuggerDataViewerExperimentEnabler'));
}
private async activateInternal() {
// This context key controls the visibility of the 'View Variable in Data Viewer'
// context menu item from the variable window context menu during a debugging session
const isDataViewerExperimentEnabled = new ContextKey(
'python.isDebuggerDataViewerExperimentEnabled',
this.commandManager
);
await isDataViewerExperimentEnabled.set(await this.experimentService.inExperiment('debuggerDataViewer'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Licensed under the MIT License.
'use strict';
import * as monacoEditor from 'monaco-editor/esm/vs/editor/editor.api';
import { DebugProtocolVariable, DebugProtocolVariableContainer, Uri } from 'vscode';
import { Uri } from 'vscode';
import { DebugProtocolVariable, DebugProtocolVariableContainer } from '../../../../types/vscode-proposed';
import { DebugState, IServerState } from '../../../datascience-ui/interactive-common/mainState';

import type { KernelMessage } from '@jupyterlab/services';
Expand Down
3 changes: 3 additions & 0 deletions src/client/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export enum EventName {
DEBUGGER_ATTACH_TO_LOCAL_PROCESS = 'DEBUGGER.ATTACH_TO_LOCAL_PROCESS',
DEBUGGER_CONFIGURATION_PROMPTS = 'DEBUGGER.CONFIGURATION.PROMPTS',
DEBUGGER_CONFIGURATION_PROMPTS_IN_LAUNCH_JSON = 'DEBUGGER.CONFIGURATION.PROMPTS.IN.LAUNCH.JSON',
OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST = 'OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST',
OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR = 'OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR',
OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS = 'OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS',
UNITTEST_STOP = 'UNITTEST.STOP',
UNITTEST_DISABLE = 'UNITTEST.DISABLE',
UNITTEST_RUN = 'UNITTEST.RUN',
Expand Down
6 changes: 3 additions & 3 deletions src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ export interface IEventNamePropertyMapping {
*/
manuallyEnteredAValue?: boolean;
};
[EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST]: never | undefined;
[EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR]: never | undefined;
[EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS]: never | undefined;
/**
* Telemetry event sent when providing completion provider in launch.json. It is sent just *after* inserting the completion.
*/
Expand Down Expand Up @@ -1772,9 +1775,6 @@ export interface IEventNamePropertyMapping {
[Telemetry.SetJupyterURIToUserSpecified]: never | undefined;
[Telemetry.ShiftEnterBannerShown]: never | undefined;
[Telemetry.ShowDataViewer]: { rows: number | undefined; columns: number | undefined };
[Telemetry.OpenDataViewerFromVariableWindowRequest]: never | undefined;
[Telemetry.OpenDataViewerFromVariableWindowError]: never | undefined;
[Telemetry.OpenDataViewerFromVariableWindowSuccess]: never | undefined;
[Telemetry.CreateNewInteractive]: never | undefined;
[Telemetry.StartJupyter]: never | undefined;
[Telemetry.StartJupyterProcess]: never | undefined;
Expand Down
19 changes: 19 additions & 0 deletions types/vscode-proposed/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -730,3 +730,22 @@ export namespace notebook {
priority?: number
): NotebookCellStatusBarItem;
}

//#region debug

/**
* A DebugProtocolVariableContainer is an opaque stand-in type for the intersection of the Scope and Variable types defined in the Debug Adapter Protocol.
* See https://microsoft.github.io/debug-adapter-protocol/specification#Types_Scope and https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable.
*/
export interface DebugProtocolVariableContainer {
// Properties: the intersection of DAP's Scope and Variable types.
}

/**
* A DebugProtocolVariable is an opaque stand-in type for the Variable type defined in the Debug Adapter Protocol.
* See https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable.
*/
export interface DebugProtocolVariable {
// Properties: see details [here](https://microsoft.github.io/debug-adapter-protocol/specification#Base_Protocol_Variable).
}
//#endregion