diff --git a/TELEMETRY.md b/TELEMETRY.md index dc85e975d14..3915dc3c2a8 100644 --- a/TELEMETRY.md +++ b/TELEMETRY.md @@ -21,12 +21,12 @@ No properties for event [src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.AddCellBelow) - private async addCellBelow(): Promise { - await this.getCurrentCodeWatcher()?.addEmptyCellToBottom(); + } + } + + @captureTelemetry(Telemetry.AddCellBelow) + private async addCellBelow(): Promise { + await this.getCurrentCodeWatcher()?.addEmptyCellToBottom(); } ``` @@ -47,48 +47,48 @@ No description provided [src/webviews/extension-side/import-export/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/import-export/exportCommands.ts) ```typescript - if (pickedItem !== undefined) { - pickedItem.handler(); - } else { - sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick); - } - } + if (pickedItem !== undefined) { + pickedItem.handler(); + } else { + sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick); + } + } } ``` [src/webviews/extension-side/import-export/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/import-export/exportCommands.ts) ```typescript - label: DataScience.exportPythonQuickPickLabel(), - picked: true, - handler: () => { - sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { - format: ExportFormat.python - }); + label: DataScience.exportPythonQuickPickLabel(), + picked: true, + handler: () => { + sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { + format: ExportFormat.python + }); this.commandManager ``` [src/webviews/extension-side/import-export/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/import-export/exportCommands.ts) ```typescript - label: DataScience.exportHTMLQuickPickLabel(), - picked: false, - handler: () => { - sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { - format: ExportFormat.html - }); + label: DataScience.exportHTMLQuickPickLabel(), + picked: false, + handler: () => { + sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { + format: ExportFormat.html + }); this.commandManager ``` [src/webviews/extension-side/import-export/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/import-export/exportCommands.ts) ```typescript - label: DataScience.exportPDFQuickPickLabel(), - picked: false, - handler: () => { - sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { - format: ExportFormat.pdf - }); + label: DataScience.exportPDFQuickPickLabel(), + picked: false, + handler: () => { + sendTelemetryEvent(Telemetry.ClickedExportNotebookAsQuickPick, undefined, { + format: ExportFormat.pdf + }); this.commandManager ``` @@ -149,12 +149,12 @@ No properties for event [src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.CreateNewInteractive, undefined, false) - private async createNewInteractiveWindow(connection?: KernelConnectionMetadata): Promise { - await this.interactiveWindowProvider.getOrCreate(undefined, connection); + } + } + + @captureTelemetry(Telemetry.CreateNewInteractive, undefined, false) + private async createNewInteractiveWindow(connection?: KernelConnectionMetadata): Promise { + await this.interactiveWindowProvider.getOrCreate(undefined, connection); } ``` @@ -180,12 +180,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) ```typescript - - private maybeSendSliceDataDimensionalityTelemetry(numberOfDimensions: number) { - if (!this.sentDataViewerSliceDimensionalityTelemetry) { - sendTelemetryEvent(Telemetry.DataViewerDataDimensionality, undefined, { numberOfDimensions }); - this.sentDataViewerSliceDimensionalityTelemetry = true; - } + + private maybeSendSliceDataDimensionalityTelemetry(numberOfDimensions: number) { + if (!this.sentDataViewerSliceDimensionalityTelemetry) { + sendTelemetryEvent(Telemetry.DataViewerDataDimensionality, undefined, { numberOfDimensions }); + this.sentDataViewerSliceDimensionalityTelemetry = true; + } } ``` @@ -212,12 +212,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) ```typescript - break; - - case DataViewerMessages.SliceEnablementStateChanged: - void sendTelemetryEvent(Telemetry.DataViewerSliceEnablementStateChanged, undefined, { - newState: payload.newState ? CheckboxState.Checked : CheckboxState.Unchecked - }); + break; + + case DataViewerMessages.SliceEnablementStateChanged: + void sendTelemetryEvent(Telemetry.DataViewerSliceEnablementStateChanged, undefined, { + newState: payload.newState ? CheckboxState.Checked : CheckboxState.Unchecked + }); break; ``` @@ -243,12 +243,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) ```typescript - if (payload.shape?.length) { - this.maybeSendSliceDataDimensionalityTelemetry(payload.shape.length); - } - sendTelemetryEvent(Telemetry.DataViewerSliceOperation, undefined, { source: request.source }); - return this.postMessage(DataViewerMessages.InitializeData, payload); - } + if (payload.shape?.length) { + this.maybeSendSliceDataDimensionalityTelemetry(payload.shape.length); + } + sendTelemetryEvent(Telemetry.DataViewerSliceOperation, undefined, { source: request.source }); + return this.postMessage(DataViewerMessages.InitializeData, payload); + } }); ``` @@ -271,12 +271,12 @@ No properties for event [src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.DebugContinue) - private async debugContinue(): Promise { - // Make sure that we are in debug mode + } + } + + @captureTelemetry(Telemetry.DebugContinue) + private async debugContinue(): Promise { + // Make sure that we are in debug mode if (this.debugService?.activeDebugSession) { ``` @@ -299,24 +299,24 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - return this.codeLenses; - } - - @captureTelemetry(Telemetry.DebugCurrentCell) - public async debugCurrentCell() { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { + return this.codeLenses; + } + + @captureTelemetry(Telemetry.DebugCurrentCell) + public async debugCurrentCell() { + if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { return; ``` [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - return this.runMatchingCell(range, advance); - } - - @captureTelemetry(Telemetry.DebugCurrentCell) - public async debugCell(range: Range): Promise { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { + return this.runMatchingCell(range, advance); + } + + @captureTelemetry(Telemetry.DebugCurrentCell) + public async debugCell(range: Range): Promise { + if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { return; ``` @@ -339,12 +339,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - return this.runFileInteractiveInternal(false); - } - - @captureTelemetry(Telemetry.DebugFileInteractive) - public async debugFileInteractive() { - return this.runFileInteractiveInternal(true); + return this.runFileInteractiveInternal(false); + } + + @captureTelemetry(Telemetry.DebugFileInteractive) + public async debugFileInteractive() { + return this.runFileInteractiveInternal(true); } ``` @@ -367,12 +367,12 @@ No properties for event [src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.DebugStepOver) - private async debugStepOver(): Promise { - // Make sure that we are in debug mode + } + } + + @captureTelemetry(Telemetry.DebugStepOver) + private async debugStepOver(): Promise { + // Make sure that we are in debug mode if (this.debugService?.activeDebugSession) { ``` @@ -395,12 +395,12 @@ No properties for event [src/interactive-window/commands/commandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.DebugStop) - private async debugStop(uri: Uri): Promise { - // Make sure that we are in debug mode + } + } + + @captureTelemetry(Telemetry.DebugStop) + private async debugStop(uri: Uri): Promise { + // Make sure that we are in debug mode if (this.debugService?.activeDebugSession && this.interactiveWindowProvider) { ``` @@ -423,12 +423,12 @@ No properties for event [src/notebooks/debugger/debuggingManagerBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManagerBase.ts) ```typescript - ); - - if (response === DataScience.setup()) { - sendTelemetryEvent(DebuggingTelemetry.clickedOnSetup); - this.appShell.openUrl( - 'https://github.com/microsoft/vscode-jupyter/wiki/Setting-Up-Run-by-Line-and-Debugging-for-Notebooks' + ); + + if (response === DataScience.setup()) { + sendTelemetryEvent(DebuggingTelemetry.clickedOnSetup); + this.appShell.openUrl( + 'https://github.com/microsoft/vscode-jupyter/wiki/Setting-Up-Run-by-Line-and-Debugging-for-Notebooks' ); ``` @@ -451,12 +451,12 @@ No properties for event [src/notebooks/debugger/debuggingManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManager.ts) ```typescript - }), - - this.commandManager.registerCommand(DSCommands.RunAndDebugCell, async (cell: NotebookCell | undefined) => { - sendTelemetryEvent(DebuggingTelemetry.clickedRunAndDebugCell); - const editor = this.vscNotebook.activeNotebookEditor; - if (!cell) { + }), + + this.commandManager.registerCommand(DSCommands.RunAndDebugCell, async (cell: NotebookCell | undefined) => { + sendTelemetryEvent(DebuggingTelemetry.clickedRunAndDebugCell); + const editor = this.vscNotebook.activeNotebookEditor; + if (!cell) { const range = editor?.selections[0]; ``` @@ -479,12 +479,12 @@ No properties for event [src/notebooks/debugger/debuggingManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManager.ts) ```typescript - }), - - this.commandManager.registerCommand(DSCommands.RunByLine, async (cell: NotebookCell | undefined) => { - sendTelemetryEvent(DebuggingTelemetry.clickedRunByLine); - const editor = this.vscNotebook.activeNotebookEditor; - if (!cell) { + }), + + this.commandManager.registerCommand(DSCommands.RunByLine, async (cell: NotebookCell | undefined) => { + sendTelemetryEvent(DebuggingTelemetry.clickedRunByLine); + const editor = this.vscNotebook.activeNotebookEditor; + if (!cell) { const range = editor?.selections[0]; ``` @@ -507,12 +507,12 @@ No properties for event [src/notebooks/debugger/debuggingManagerBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManagerBase.ts) ```typescript - 'https://github.com/microsoft/vscode-jupyter/wiki/Setting-Up-Run-by-Line-and-Debugging-for-Notebooks' - ); - } else { - sendTelemetryEvent(DebuggingTelemetry.closedModal); - } - } + 'https://github.com/microsoft/vscode-jupyter/wiki/Setting-Up-Run-by-Line-and-Debugging-for-Notebooks' + ); + } else { + sendTelemetryEvent(DebuggingTelemetry.closedModal); + } + } } ``` @@ -527,43 +527,43 @@ No description provided ## Properties -- +- reason: 'normally' | 'onKernelDisposed' | 'onAnInterrupt' | 'onARestart' | 'withKeybinding'; ## Locations Used [src/kernels/debugger/kernelDebugAdapterBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugger/kernelDebugAdapterBase.ts) ```typescript - this.kernel.onDisposed(() => { - debug.stopDebugging(this.session).then(noop, noop); - this.endSession.fire(this.session); - sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'onKernelDisposed' }); - }) - ); + this.kernel.onDisposed(() => { + debug.stopDebugging(this.session).then(noop, noop); + this.endSession.fire(this.session); + sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'onKernelDisposed' }); + }) + ); } ``` [src/kernels/debugger/kernelDebugAdapterBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugger/kernelDebugAdapterBase.ts) ```typescript - cellStateChange.state === NotebookCellExecutionState.Idle && - !this.disconnected - ) { - sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'normally' }); - this.disconnect().ignoreErrors(); - } + cellStateChange.state === NotebookCellExecutionState.Idle && + !this.disconnected + ) { + sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'normally' }); + this.disconnect().ignoreErrors(); + } }, ``` [src/notebooks/debugger/debuggingManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManager.ts) ```typescript - if (editor) { - const controller = this.notebookToRunByLineController.get(editor.notebook); - if (controller) { - sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { - reason: 'withKeybinding' - }); + if (editor) { + const controller = this.notebookToRunByLineController.get(editor.notebook); + if (controller) { + sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { + reason: 'withKeybinding' + }); controller.stop(); ``` @@ -578,19 +578,19 @@ No description provided ## Properties -- +- status: 'installed' | 'notInstalled'; ## Locations Used [src/notebooks/debugger/debuggingManagerBase.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debuggingManagerBase.ts) ```typescript - } - - const result = await isUsingIpykernel6OrLater(kernel); - sendTelemetryEvent(DebuggingTelemetry.ipykernel6Status, undefined, { - status: result === IpykernelCheckResult.Ok ? 'installed' : 'notInstalled' - }); + } + + const result = await isUsingIpykernel6OrLater(kernel); + sendTelemetryEvent(DebuggingTelemetry.ipykernel6Status, undefined, { + status: result === IpykernelCheckResult.Ok ? 'installed' : 'notInstalled' + }); return result; ``` @@ -634,24 +634,24 @@ No properties for event [src/notebooks/debugger/debugCellControllers.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/debugCellControllers.ts) ```typescript - private readonly kernel: IKernel, - private readonly commandManager: ICommandManager - ) { - sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunAndDebugCell); - } - + private readonly kernel: IKernel, + private readonly commandManager: ICommandManager + ) { + sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunAndDebugCell); + } + public async willSendEvent(_msg: DebugProtocolMessage): Promise { ``` [src/interactive-window/debugger/jupyter/debugCellControllers.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/jupyter/debugCellControllers.ts) ```typescript - public readonly debugCell: NotebookCell, - private readonly kernel: IKernel - ) { - sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunAndDebugCell); - } - + public readonly debugCell: NotebookCell, + private readonly kernel: IKernel + ) { + sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunAndDebugCell); + } + public async willSendEvent(_msg: DebugProtocolMessage): Promise { ``` @@ -674,12 +674,12 @@ No properties for event [src/notebooks/debugger/runByLineController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/debugger/runByLineController.ts) ```typescript - private readonly kernel: IKernel, - private readonly settings: IConfigurationService - ) { - sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunByLine); - } - + private readonly kernel: IKernel, + private readonly settings: IConfigurationService + ) { + sendTelemetryEvent(DebuggingTelemetry.successfullyStartedRunByLine); + } + public continue(): void { ``` @@ -816,24 +816,24 @@ No properties for event [src/interactive-window/shiftEnterBanner.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/shiftEnterBanner.ts) ```typescript - ); - } - - @captureTelemetry(Telemetry.DisableInteractiveShiftEnter) - public async disableInteractiveShiftEnter(): Promise { - await this.configuration.updateSetting( + ); + } + + @captureTelemetry(Telemetry.DisableInteractiveShiftEnter) + public async disableInteractiveShiftEnter(): Promise { + await this.configuration.updateSetting( 'sendSelectionToInteractiveWindow', ``` [src/test/datascience/shiftEnterBanner.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts) ```typescript - - expect(Reporter.eventNames).to.deep.equal([ - Telemetry.ShiftEnterBannerShown, - Telemetry.DisableInteractiveShiftEnter - ]); - }); + + expect(Reporter.eventNames).to.deep.equal([ + Telemetry.ShiftEnterBannerShown, + Telemetry.DisableInteractiveShiftEnter + ]); + }); }); ``` @@ -856,24 +856,24 @@ No properties for event [src/interactive-window/shiftEnterBanner.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/shiftEnterBanner.ts) ```typescript - await this.disableBanner(); - } - - @captureTelemetry(Telemetry.EnableInteractiveShiftEnter) - public async enableInteractiveShiftEnter(): Promise { - await this.configuration.updateSetting( + await this.disableBanner(); + } + + @captureTelemetry(Telemetry.EnableInteractiveShiftEnter) + public async enableInteractiveShiftEnter(): Promise { + await this.configuration.updateSetting( 'sendSelectionToInteractiveWindow', ``` [src/test/datascience/shiftEnterBanner.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts) ```typescript - - expect(Reporter.eventNames).to.deep.equal([ - Telemetry.ShiftEnterBannerShown, - Telemetry.EnableInteractiveShiftEnter - ]); - }); + + expect(Reporter.eventNames).to.deep.equal([ + Telemetry.ShiftEnterBannerShown, + Telemetry.EnableInteractiveShiftEnter + ]); + }); ``` @@ -898,12 +898,12 @@ No properties for event [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - return multiStep.run(this.startSelectingURI.bind(this, allowLocal), {}); - } - - @captureTelemetry(Telemetry.EnterJupyterURI) - @traceDecoratorError('Failed to enter Jupyter Uri') - public async enterJupyterURI(): Promise { + return multiStep.run(this.startSelectingURI.bind(this, allowLocal), {}); + } + + @captureTelemetry(Telemetry.EnterJupyterURI) + @traceDecoratorError('Failed to enter Jupyter Uri') + public async enterJupyterURI(): Promise { let initialValue = defaultUri; ``` @@ -951,36 +951,36 @@ No properties for event [src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) ```typescript - return; - } - initializeInteractiveOrNotebookTelemetryBasedOnUserAction(notebook.uri, this.connection); - sendKernelTelemetryEvent(notebook.uri, Telemetry.ExecuteCell); - // Notebook is trusted. Continue to execute cells - await Promise.all(cells.map((cell) => this.executeCell(notebook, cell))); + return; + } + initializeInteractiveOrNotebookTelemetryBasedOnUserAction(notebook.uri, this.connection); + sendKernelTelemetryEvent(notebook.uri, Telemetry.ExecuteCell); + // Notebook is trusted. Continue to execute cells + await Promise.all(cells.map((cell) => this.executeCell(notebook, cell))); } ``` [src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) ```typescript - } - public async executeCell(cell: NotebookCell, codeOverride?: string): Promise { - traceCellMessage(cell, `kernel.executeCell, ${getDisplayPath(cell.notebook.uri)}`); - sendKernelTelemetryEvent(this.resourceUri, Telemetry.ExecuteCell); - const stopWatch = new StopWatch(); - const sessionPromise = this.startJupyterSession(); + } + public async executeCell(cell: NotebookCell, codeOverride?: string): Promise { + traceCellMessage(cell, `kernel.executeCell, ${getDisplayPath(cell.notebook.uri)}`); + sendKernelTelemetryEvent(this.resourceUri, Telemetry.ExecuteCell); + const stopWatch = new StopWatch(); + const sessionPromise = this.startJupyterSession(); const promise = this.kernelExecution.executeCell(sessionPromise, cell, codeOverride); ``` [src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) ```typescript - }; - - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.ExecuteCell); - assertEvent(Telemetry.OpenNotebookAll); - assertEvent(Telemetry.NotebookStart); + }; + + // Right now this is the guaranteed list. Might want to expand this. + assertEvent(Telemetry.ExecuteCell); + assertEvent(Telemetry.OpenNotebookAll); + assertEvent(Telemetry.NotebookStart); }); ``` @@ -1061,36 +1061,36 @@ No description provided [src/notebooks/export/exportFileOpener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/export/exportFileOpener.ts) ```typescript - public async openFile(format: ExportFormat, uri: Uri, openDirectly: boolean = false) { - if (format === ExportFormat.python) { - await this.openPythonFile(uri, openDirectly); - sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { - format: format, - successful: true, + public async openFile(format: ExportFormat, uri: Uri, openDirectly: boolean = false) { + if (format === ExportFormat.python) { + await this.openPythonFile(uri, openDirectly); + sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { + format: format, + successful: true, opened: true ``` [src/notebooks/export/exportFileOpener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/export/exportFileOpener.ts) ```typescript - }); - } else { - const opened = await this.askOpenFile(uri, openDirectly); - sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { - format: format, - successful: true, + }); + } else { + const opened = await this.askOpenFile(uri, openDirectly); + sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { + format: format, + successful: true, opened: opened ``` [src/notebooks/export/fileConverter.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/export/fileConverter.ts) ```typescript - } - - if (reporter.token.isCancellationRequested) { - sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { format: format, cancelled: true }); - return; - } + } + + if (reporter.token.isCancellationRequested) { + sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { format: format, cancelled: true }); + return; + } } ``` @@ -1111,12 +1111,12 @@ No description provided [src/webviews/extension-side/import-export/exportCommands.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/import-export/exportCommands.ts) ```typescript - this.controllers.getSelectedNotebookController(sourceDocument)?.connection.interpreter || - this.controllers.getPreferredNotebookController(sourceDocument)?.connection.interpreter; - if (exportMethod) { - sendTelemetryEvent(Telemetry.ExportNotebookAsCommand, undefined, { format: exportMethod }); - } - } + this.controllers.getSelectedNotebookController(sourceDocument)?.connection.interpreter || + this.controllers.getPreferredNotebookController(sourceDocument)?.connection.interpreter; + if (exportMethod) { + sendTelemetryEvent(Telemetry.ExportNotebookAsCommand, undefined, { format: exportMethod }); + } + } ``` @@ -1137,12 +1137,12 @@ No description provided [src/notebooks/export/fileConverter.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/export/fileConverter.ts) ```typescript - await this.performExport(format, sourceDocument, target, token, candidateInterpreter); - } catch (e) { - traceError('Export failed', e); - sendTelemetryEvent(Telemetry.ExportNotebookAsFailed, undefined, { format: format }); - - if (format === ExportFormat.pdf) { + await this.performExport(format, sourceDocument, target, token, candidateInterpreter); + } catch (e) { + traceError('Export failed', e); + sendTelemetryEvent(Telemetry.ExportNotebookAsFailed, undefined, { format: format }); + + if (format === ExportFormat.pdf) { traceError(localize.DataScience.exportToPDFDependencyMessage()); ``` @@ -1165,12 +1165,12 @@ No properties for event [src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) ```typescript - return result; - } - - @captureTelemetry(Telemetry.ExportPythonFileInteractive, undefined, false) - private async exportFile(file: Uri): Promise { - const filePath = getFilePath(file); + return result; + } + + @captureTelemetry(Telemetry.ExportPythonFileInteractive, undefined, false) + private async exportFile(file: Uri): Promise { + const filePath = getFilePath(file); if (filePath && filePath.length > 0 && this.jupyterExporter) { ``` @@ -1193,12 +1193,12 @@ No properties for event [src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.ExportPythonFileAndOutputInteractive, undefined, false) - private async exportFileAndOutput(file: Uri): Promise { - const filePath = getFilePath(file); + } + } + + @captureTelemetry(Telemetry.ExportPythonFileAndOutputInteractive, undefined, false) + private async exportFileAndOutput(file: Uri): Promise { + const filePath = getFilePath(file); if ( ``` @@ -1221,12 +1221,12 @@ No properties for event [src/webviews/extension-side/variablesView/variableView.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/variablesView/variableView.ts) ```typescript - } - } catch (e) { - traceError(e); - sendTelemetryEvent(Telemetry.FailedShowDataViewer); - this.appShell.showErrorMessage(localize.DataScience.showDataViewerFail()).then(noop, noop); - } + } + } catch (e) { + traceError(e); + sendTelemetryEvent(Telemetry.FailedShowDataViewer); + this.appShell.showErrorMessage(localize.DataScience.showDataViewerFail()).then(noop, noop); + } } ``` @@ -1250,12 +1250,12 @@ No properties for event [src/notebooks/controllers/notebookControllerManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/notebookControllerManager.ts) ```typescript - } - // We know that this fails when we have xeus kernels installed (untill that's resolved thats one instance when we can have duplicates). - sendTelemetryEvent( - Telemetry.FailedToCreateNotebookController, - undefined, - { kind: kernelConnection.kind }, + } + // We know that this fails when we have xeus kernels installed (untill that's resolved thats one instance when we can have duplicates). + sendTelemetryEvent( + Telemetry.FailedToCreateNotebookController, + undefined, + { kind: kernelConnection.kind }, // eslint-disable-next-line @typescript-eslint/no-explicit-any ``` @@ -1301,12 +1301,12 @@ No properties for event [src/kernels/kernelFinder.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelFinder.base.ts) ```typescript - const key = `${kind}:${useCache}`; - if (this.startTimeForFetching && !this.fetchingTelemetrySent.has(key)) { - this.fetchingTelemetrySent.add(key); - sendTelemetryEvent(Telemetry.FetchControllers, this.startTimeForFetching.elapsedTime, { - cached: useCache === 'useCache', - kind + const key = `${kind}:${useCache}`; + if (this.startTimeForFetching && !this.fetchingTelemetrySent.has(key)) { + this.fetchingTelemetrySent.add(key); + sendTelemetryEvent(Telemetry.FetchControllers, this.startTimeForFetching.elapsedTime, { + cached: useCache === 'useCache', + kind }); ``` @@ -1329,12 +1329,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) ```typescript - this.serverUriStorage.onDidRemoveUris(this.onDidRemoveUris, this, this.disposables); - } - - @captureTelemetry(Telemetry.GetPasswordAttempt) - public getPasswordConnectionInfo(url: string): Promise { - if (!url || url.length < 1) { + this.serverUriStorage.onDidRemoveUris(this.onDidRemoveUris, this, this.disposables); + } + + @captureTelemetry(Telemetry.GetPasswordAttempt) + public getPasswordConnectionInfo(url: string): Promise { + if (!url || url.length < 1) { return Promise.resolve(undefined); ``` @@ -1357,12 +1357,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - }); - } - - @captureTelemetry(Telemetry.GotoNextCellInFile) - public gotoNextCell() { - const editor = this.documentManager.activeTextEditor; + }); + } + + @captureTelemetry(Telemetry.GotoNextCellInFile) + public gotoNextCell() { + const editor = this.documentManager.activeTextEditor; if (!editor || !editor.selection) { ``` @@ -1385,12 +1385,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.GotoPrevCellInFile) - public gotoPreviousCell() { - const editor = this.documentManager.activeTextEditor; + } + } + + @captureTelemetry(Telemetry.GotoPrevCellInFile) + public gotoPreviousCell() { + const editor = this.documentManager.activeTextEditor; if (!editor || !editor.selection) { ``` @@ -1430,24 +1430,24 @@ No description provided [src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) ```typescript - return this.statusProvider.waitWithStatus(promise, message, undefined, canceled); - } - - @captureTelemetry(Telemetry.ImportNotebook, { scope: 'command' }, false) - private async importNotebook(): Promise { - const filtersKey = localize.DataScience.importDialogFilter(); + return this.statusProvider.waitWithStatus(promise, message, undefined, canceled); + } + + @captureTelemetry(Telemetry.ImportNotebook, { scope: 'command' }, false) + private async importNotebook(): Promise { + const filtersKey = localize.DataScience.importDialogFilter(); const filtersObject: { [name: string]: string[] } = {}; ``` [src/interactive-window/interactiveWindowCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.ImportNotebook, { scope: 'file' }, false) - private async importNotebookOnFile(file: Uri): Promise { - const filepath = getFilePath(file); + } + } + + @captureTelemetry(Telemetry.ImportNotebook, { scope: 'file' }, false) + private async importNotebookOnFile(file: Uri): Promise { + const filepath = getFilePath(file); if (filepath && filepath.length > 0) { ``` @@ -1462,69 +1462,69 @@ No description provided ## Properties -- +- ename: string; -- +- evalue: string; ## Locations Used [src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) ```typescript - executeSilently(kernel.session, this.tracingEnableCode, { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure enabling tracing code for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - }).ignoreErrors(); - } + executeSilently(kernel.session, this.tracingEnableCode, { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure enabling tracing code for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + }).ignoreErrors(); + } ``` [src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) ```typescript - executeSilently(kernel.session, this.tracingDisableCode, { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure disabling tracing code for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - }).ignoreErrors(); - } + executeSilently(kernel.session, this.tracingDisableCode, { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure disabling tracing code for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + }).ignoreErrors(); + } ``` [src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) ```typescript - const importResults = await executeSilently(kernel.session, this.waitForDebugClientCode, { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure starting debug session for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - }); - if (importResults.some((item) => item.output_type === 'error')) { + const importResults = await executeSilently(kernel.session, this.waitForDebugClientCode, { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure starting debug session for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + }); + if (importResults.some((item) => item.output_type === 'error')) { traceWarning(`${this.debuggerPackage} not found in path.`); ``` [src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) ```typescript - { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure appending debugger paths for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - } - ) + { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure appending debugger paths for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + } + ) : []; ``` [src/interactive-window/debugger/interactiveWindowDebugger.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/debugger/interactiveWindowDebugger.node.ts) ```typescript - ? await executeSilently(kernel.session, this.enableDebuggerCode, { - traceErrors: true, - traceErrorsMessage: 'Execute_request failure enabling debugging for IW', - telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure - }) - : []; + ? await executeSilently(kernel.session, this.enableDebuggerCode, { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure enabling debugging for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + }) + : []; ``` @@ -1547,12 +1547,12 @@ No properties for event [src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) ```typescript - this.documentExecutions.set(document, newCellExecutionQueue); - return newCellExecutionQueue; - } - @captureTelemetry(Telemetry.Interrupt) - @captureTelemetry(Telemetry.InterruptJupyterTime) - private async interruptExecution( + this.documentExecutions.set(document, newCellExecutionQueue); + return newCellExecutionQueue; + } + @captureTelemetry(Telemetry.Interrupt) + @captureTelemetry(Telemetry.InterruptJupyterTime) + private async interruptExecution( session: IJupyterSession, ``` @@ -1567,9 +1567,9 @@ No description provided ## Properties -- +- where: 'activeInterpreter' | 'otherInterpreter' | 'path' | 'nowhere'; -- +- command: JupyterCommands; ## Locations Used @@ -1587,33 +1587,33 @@ No description provided ## Properties -- +- extensionId: string; -- +- allowed: 'yes' | 'no'; ## Locations Used [src/platform/api/apiAccessService.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/apiAccessService.ts) ```typescript - const extensionPermissions = this.globalState.get(API_ACCESS_GLOBAL_KEY); - const extensionPermission = extensionPermissions?.find((item) => item.extensionId === info.extensionId); - if (extensionPermission) { - sendTelemetryEvent(Telemetry.JupyterKernelApiAccess, undefined, { - extensionId: info.extensionId, - allowed: extensionPermission.allowed + const extensionPermissions = this.globalState.get(API_ACCESS_GLOBAL_KEY); + const extensionPermission = extensionPermissions?.find((item) => item.extensionId === info.extensionId); + if (extensionPermission) { + sendTelemetryEvent(Telemetry.JupyterKernelApiAccess, undefined, { + extensionId: info.extensionId, + allowed: extensionPermission.allowed }); ``` [src/platform/api/apiAccessService.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/apiAccessService.ts) ```typescript - return this.globalState.update(API_ACCESS_GLOBAL_KEY, extensionPermissions); - }) - .then(noop, noop); - sendTelemetryEvent(Telemetry.JupyterKernelApiAccess, undefined, { - extensionId: info.extensionId, - allowed: allow ? 'yes' : 'no' + return this.globalState.update(API_ACCESS_GLOBAL_KEY, extensionPermissions); + }) + .then(noop, noop); + sendTelemetryEvent(Telemetry.JupyterKernelApiAccess, undefined, { + extensionId: info.extensionId, + allowed: allow ? 'yes' : 'no' }); ``` @@ -1628,93 +1628,93 @@ No description provided ## Properties -- +- extensionId: string; -- +- pemUsed: keyof IExportedKernelService; ## Locations Used [src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) ```typescript - KernelConnectionMetadata - >(); - public get onDidChangeKernelSpecifications(): Event { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'onDidChangeKernelSpecifications' + KernelConnectionMetadata + >(); + public get onDidChangeKernelSpecifications(): Event { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'onDidChangeKernelSpecifications' }); ``` [src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) ```typescript - return this._onDidChangeKernelSpecifications.event; - } - public get onDidChangeKernels(): Event { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'onDidChangeKernels' + return this._onDidChangeKernelSpecifications.event; + } + public get onDidChangeKernels(): Event { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'onDidChangeKernels' }); ``` [src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) ```typescript - ); - } - async getKernelSpecifications(refresh?: boolean): Promise { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'getKernelSpecifications' + ); + } + async getKernelSpecifications(refresh?: boolean): Promise { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'getKernelSpecifications' }); ``` [src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) ```typescript - return items.map((item) => this.translateKernelConnectionMetadataToExportedType(item)); - } - getActiveKernels(): { metadata: KernelConnectionMetadata; uri: Uri | undefined }[] { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'getActiveKernels' + return items.map((item) => this.translateKernelConnectionMetadataToExportedType(item)); + } + getActiveKernels(): { metadata: KernelConnectionMetadata; uri: Uri | undefined }[] { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'getActiveKernels' }); ``` [src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) ```typescript - return kernels; - } - getKernel(uri: Uri): { metadata: KernelConnectionMetadata; connection: IKernelConnectionInfo } | undefined { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'getKernel' + return kernels; + } + getKernel(uri: Uri): { metadata: KernelConnectionMetadata; connection: IKernelConnectionInfo } | undefined { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'getKernel' }); ``` [src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) ```typescript - } - } - async startKernel(spec: KernelConnectionMetadata, uri: Uri): Promise { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'startKernel' + } + } + async startKernel(spec: KernelConnectionMetadata, uri: Uri): Promise { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'startKernel' }); ``` [src/platform/api/kernelApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts) ```typescript - return this.startOrConnect(spec, uri); - } - async connect(spec: ActiveKernel, uri: Uri): Promise { - sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { - extensionId: this.callingExtensionId, - pemUsed: 'connect' + return this.startOrConnect(spec, uri); + } + async connect(spec: ActiveKernel, uri: Uri): Promise { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'connect' }); ``` @@ -1737,12 +1737,12 @@ No properties for event [src/notebooks/controllers/kernelFilter/kernelFilterUI.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/kernelFilter/kernelFilterUI.ts) ```typescript - .map((item) => item.connection) - .filter((item) => !selectedItems.has(item)); - this.kernelFilter.storeHiddenKernels(hiddenConnections.map((item) => item)).then(noop, noop); - sendTelemetryEvent(Telemetry.JupyterKernelFilterUsed); - }, - this, + .map((item) => item.connection) + .filter((item) => !selectedItems.has(item)); + this.kernelFilter.storeHiddenKernels(hiddenConnections.map((item) => item)).then(noop, noop); + sendTelemetryEvent(Telemetry.JupyterKernelFilterUsed); + }, + this, disposables ``` @@ -1765,12 +1765,12 @@ No properties for event [src/notebooks/controllers/kernelFilter/kernelFilterService.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/kernelFilter/kernelFilterService.ts) ```typescript - }); - - if (hidden) { - sendTelemetryEvent(Telemetry.JupyterKernelHiddenViaFilter); - } - return hidden; + }); + + if (hidden) { + sendTelemetryEvent(Telemetry.JupyterKernelHiddenViaFilter); + } + return hidden; } ``` @@ -1793,12 +1793,12 @@ No properties for event [src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) ```typescript - moduleName: ProductNames.get(Product.jupyter)!, - pythonEnvType: interpreter.envType - }); - sendTelemetryEvent(Telemetry.JupyterNotInstalledErrorShown); - const selection = await this.applicationShell.showErrorMessage( - message, + moduleName: ProductNames.get(Product.jupyter)!, + pythonEnvType: interpreter.envType + }); + sendTelemetryEvent(Telemetry.JupyterNotInstalledErrorShown); + const selection = await this.applicationShell.showErrorMessage( + message, { modal: true }, ``` @@ -1821,12 +1821,12 @@ No properties for event [src/kernels/kernelCrashMonitor.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelCrashMonitor.ts) ```typescript - } - private async endCellAndDisplayErrorsInCell(kernel: IKernel) { - const lastExecutedCell = this.lastExecutedCellPerKernel.get(kernel); - sendKernelTelemetryEvent(kernel.resourceUri, Telemetry.KernelCrash); - if (!lastExecutedCell) { - return; + } + private async endCellAndDisplayErrorsInCell(kernel: IKernel) { + const lastExecutedCell = this.lastExecutedCellPerKernel.get(kernel); + sendKernelTelemetryEvent(kernel.resourceUri, Telemetry.KernelCrash); + if (!lastExecutedCell) { + return; } ``` @@ -1841,33 +1841,33 @@ No description provided ## Properties -- - /** - * Language of the kernelSpec. - */ +- + /** + * Language of the kernelSpec. + */ language: string; -- - /** - * Whether this is a local or remote kernel. - */ +- + /** + * Whether this is a local or remote kernel. + */ kind: 'local' | 'remote'; -- - /** - * Whether shell is used to start the kernel. E.g. `"/bin/sh"` is used in the argv of the kernelSpec. - * OCaml is one such kernel. - */ +- + /** + * Whether shell is used to start the kernel. E.g. `"/bin/sh"` is used in the argv of the kernelSpec. + * OCaml is one such kernel. + */ usesShell?: boolean; ## Locations Used [src/kernels/raw/finder/helper.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/helper.ts) ```typescript - arg = arg.toLowerCase(); - return shellScripts.some((shell) => arg.includes(shell)); - }); - sendTelemetryEvent(Telemetry.KernelSpecLanguage, undefined, { - language: getTelemetrySafeLanguage(kernelSpec.language), - kind, + arg = arg.toLowerCase(); + return shellScripts.some((shell) => arg.includes(shell)); + }); + sendTelemetryEvent(Telemetry.KernelSpecLanguage, undefined, { + language: getTelemetrySafeLanguage(kernelSpec.language), + kind, usesShell ``` @@ -1882,21 +1882,21 @@ No description provided ## Properties -- +- ename: string; -- +- evalue: string; ## Locations Used [src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) ```typescript - await this.executeSilently(session, startupCode, { - traceErrors: true, - traceErrorsMessage: 'Error executing jupyter extension internal startup code', - telemetryName: Telemetry.KernelStartupCodeFailure - }); - + await this.executeSilently(session, startupCode, { + traceErrors: true, + traceErrorsMessage: 'Error executing jupyter extension internal startup code', + telemetryName: Telemetry.KernelStartupCodeFailure + }); + // Run user specified startup commands ``` @@ -1938,12 +1938,12 @@ No properties for event [src/notebooks/notebookEditorProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookEditorProvider.ts) ```typescript -export class NotebookEditorProvider implements INotebookEditorProvider { - private providers: Set = new Set(); - constructor(@inject(IVSCodeNotebook) private readonly vscodeNotebook: IVSCodeNotebook) {} - @captureTelemetry(Telemetry.CreateNewNotebook, undefined, false) - public async createNew(options?: { contents?: string; defaultCellLanguage: string }): Promise { - // contents will be ignored +export class NotebookEditorProvider implements INotebookEditorProvider { + private providers: Set = new Set(); + constructor(@inject(IVSCodeNotebook) private readonly vscodeNotebook: IVSCodeNotebook) {} + @captureTelemetry(Telemetry.CreateNewNotebook, undefined, false) + public async createNew(options?: { contents?: string; defaultCellLanguage: string }): Promise { + // contents will be ignored const language = options?.defaultCellLanguage ?? PYTHON_LANGUAGE; ``` @@ -2572,24 +2572,24 @@ No properties for event [src/kernels/activation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/activation.node.ts) ```typescript - } - this.notebookOpened = true; - this.PreWarmDaemonPool().ignoreErrors(); - sendTelemetryEvent(Telemetry.OpenNotebookAll); - - if (!this.rawSupported.isSupported && this.extensionChecker.isPythonExtensionInstalled) { + } + this.notebookOpened = true; + this.PreWarmDaemonPool().ignoreErrors(); + sendTelemetryEvent(Telemetry.OpenNotebookAll); + + if (!this.rawSupported.isSupported && this.extensionChecker.isPythonExtensionInstalled) { // Warm up our selected interpreter for the extension ``` [src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) ```typescript - - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.ExecuteCell); - assertEvent(Telemetry.OpenNotebookAll); - assertEvent(Telemetry.NotebookStart); - }); + + // Right now this is the guaranteed list. Might want to expand this. + assertEvent(Telemetry.ExecuteCell); + assertEvent(Telemetry.OpenNotebookAll); + assertEvent(Telemetry.NotebookStart); + }); test('Run interactive window', async () => { ``` @@ -2626,10 +2626,10 @@ No description provided ## Properties -- - /** - * The id of the extension registering with us to be displayed the dropdown list for notebook creation. - */ +- + /** + * The id of the extension registering with us to be displayed the dropdown list for notebook creation. + */ extensionId: string; ## Locations Used @@ -2691,24 +2691,24 @@ function resetData(resource: Resource, eventName: string, properties: any) { [src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) ```typescript - // Otherwise a real error occurred. - sendKernelTelemetryEvent( - this.kernel.resourceUri, - Telemetry.NotebookInterrupt, - stopWatch.elapsedTime, - undefined, + // Otherwise a real error occurred. + sendKernelTelemetryEvent( + this.kernel.resourceUri, + Telemetry.NotebookInterrupt, + stopWatch.elapsedTime, + undefined, exc ``` [src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) ```typescript - })(); - - return promise.then((result) => { - sendKernelTelemetryEvent(this.kernel.resourceUri, Telemetry.NotebookInterrupt, stopWatch.elapsedTime, { - result - }); + })(); + + return promise.then((result) => { + sendKernelTelemetryEvent(this.kernel.resourceUri, Telemetry.NotebookInterrupt, stopWatch.elapsedTime, { + result + }); return result; ``` @@ -2736,12 +2736,12 @@ No properties for event [src/platform/common/utils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/utils.ts) ```typescript -} - -export function sendNotebookOrKernelLanguageTelemetry( - telemetryEvent: Telemetry.SwitchToExistingKernel | Telemetry.NotebookLanguage, - language?: string -) { +} + +export function sendNotebookOrKernelLanguageTelemetry( + telemetryEvent: Telemetry.SwitchToExistingKernel | Telemetry.NotebookLanguage, + language?: string +) { language = getTelemetrySafeLanguage(language); ``` @@ -2800,24 +2800,24 @@ No properties for event [src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) ```typescript - await (this._jupyterSessionPromise - ? this.kernelExecution.restart(this._jupyterSessionPromise) - : this.start(new DisplayOptions(false))); - sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime); - } catch (ex) { - traceError(`Restart failed ${getDisplayPath(this.uri)}`, ex); + await (this._jupyterSessionPromise + ? this.kernelExecution.restart(this._jupyterSessionPromise) + : this.start(new DisplayOptions(false))); + sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime); + } catch (ex) { + traceError(`Restart failed ${getDisplayPath(this.uri)}`, ex); this._ignoreJupyterSessionDisposedErrors = true; ``` [src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) ```typescript - this.restarting = undefined; - // If we get a kernel promise failure, then restarting timed out. Just shutdown and restart the entire server. - // Note, this code might not be necessary, as such an error is thrown only when interrupting a kernel times out. - sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime, undefined, ex); - await session?.dispose().catch(noop); - this._ignoreJupyterSessionDisposedErrors = false; + this.restarting = undefined; + // If we get a kernel promise failure, then restarting timed out. Just shutdown and restart the entire server. + // Note, this code might not be necessary, as such an error is thrown only when interrupting a kernel times out. + sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime, undefined, ex); + await session?.dispose().catch(noop); + this._ignoreJupyterSessionDisposedErrors = false; throw ex; ``` @@ -2876,24 +2876,24 @@ function incrementStartFailureCount(resource: Resource, eventName: any, properti [src/kernels/jupyter/launcher/notebookProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/notebookProvider.ts) ```typescript - - sendKernelTelemetryWhenDone( - options.resource, - Telemetry.NotebookStart, - promise || Promise.resolve(undefined), - undefined, + + sendKernelTelemetryWhenDone( + options.resource, + Telemetry.NotebookStart, + promise || Promise.resolve(undefined), + undefined, { ``` [src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) ```typescript - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.ExecuteCell); - assertEvent(Telemetry.OpenNotebookAll); - assertEvent(Telemetry.NotebookStart); - }); - test('Run interactive window', async () => { + // Right now this is the guaranteed list. Might want to expand this. + assertEvent(Telemetry.ExecuteCell); + assertEvent(Telemetry.OpenNotebookAll); + assertEvent(Telemetry.NotebookStart); + }); + test('Run interactive window', async () => { const { activeInteractiveWindow } = await runNewPythonFile( ``` @@ -2916,12 +2916,12 @@ No properties for event [src/webviews/extension-side/plotting/plotViewerProvider.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/plotting/plotViewerProvider.node.ts) ```typescript - this.currentViewer = this.serviceContainer.get(IPlotViewer); - this.currentViewerClosed = this.currentViewer.closed(this.closedViewer); - this.currentViewer.removed(this.removedPlot); - sendTelemetryEvent(Telemetry.OpenPlotViewer); - await this.currentViewer.show(); - } + this.currentViewer = this.serviceContainer.get(IPlotViewer); + this.currentViewerClosed = this.currentViewer.closed(this.closedViewer); + this.currentViewer.removed(this.removedPlot); + sendTelemetryEvent(Telemetry.OpenPlotViewer); + await this.currentViewer.show(); + } ``` @@ -2955,69 +2955,69 @@ No description provided ## Properties -- +- ename: string; -- +- evalue: string; ## Locations Used [src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) ```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getDataFrameInfo', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getDataFrameInfo', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ); ``` [src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) ```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getDataFrameRows', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getDataFrameRows', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ); ``` [src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) ```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getVariableProperties', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getVariableProperties', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ); result = { ...result, ...this.deserializeJupyterResult(attributes) }; ``` [src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) ```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getVariableNamesAndTypesFromKernel', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getVariableNamesAndTypesFromKernel', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ); ``` [src/kernels/variables/pythonVariableRequester.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts) ```typescript - { - traceErrors: true, - traceErrorsMessage: 'Failure in execute_request for getFullVariable', - telemetryName: Telemetry.PythonVariableFetchingCodeFailure - } - ); + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getFullVariable', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ); ``` @@ -3033,79 +3033,79 @@ No description provided ## Properties -- - /** - * Extension we recommended the user to install. - */ +- + /** + * Extension we recommended the user to install. + */ extensionId: string; -- - /** - * `displayed` - If prompt was displayed - * `dismissed` - If prompt was displayed & dismissed by the user - * `ok` - If prompt was displayed & ok clicked by the user - * `cancel` - If prompt was displayed & cancel clicked by the user - * `doNotShowAgain` - If prompt was displayed & doNotShowAgain clicked by the user - */ +- + /** + * `displayed` - If prompt was displayed + * `dismissed` - If prompt was displayed & dismissed by the user + * `ok` - If prompt was displayed & ok clicked by the user + * `cancel` - If prompt was displayed & cancel clicked by the user + * `doNotShowAgain` - If prompt was displayed & doNotShowAgain clicked by the user + */ action: 'displayed' | 'dismissed' | 'ok' | 'cancel' | 'doNotShowAgain'; ## Locations Used [src/webviews/extension-side/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/extensionRecommendation.node.ts) ```typescript - `[${extensionInfo.displayName}](${extensionInfo.extensionLink})`, - language - ); - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'displayed' }); - const selection = await this.appShell.showInformationMessage( - message, + `[${extensionInfo.displayName}](${extensionInfo.extensionLink})`, + language + ); + sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'displayed' }); + const selection = await this.appShell.showInformationMessage( + message, Common.bannerLabelYes(), ``` [src/webviews/extension-side/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/extensionRecommendation.node.ts) ```typescript - ); - switch (selection) { - case Common.bannerLabelYes(): { - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'ok' }); - this.commandManager.executeCommand('extension.open', extensionId).then(noop, noop); - break; + ); + switch (selection) { + case Common.bannerLabelYes(): { + sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'ok' }); + this.commandManager.executeCommand('extension.open', extensionId).then(noop, noop); + break; } ``` [src/webviews/extension-side/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/extensionRecommendation.node.ts) ```typescript - break; - } - case Common.bannerLabelNo(): { - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'cancel' }); - break; - } + break; + } + case Common.bannerLabelNo(): { + sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'cancel' }); + break; + } case Common.doNotShowAgain(): { ``` [src/webviews/extension-side/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/extensionRecommendation.node.ts) ```typescript - break; - } - case Common.doNotShowAgain(): { - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'doNotShowAgain' }); - const list = this.globalMemento.get(mementoKeyToNeverPromptExtensionAgain, []); - if (!list.includes(extensionId)) { + break; + } + case Common.doNotShowAgain(): { + sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'doNotShowAgain' }); + const list = this.globalMemento.get(mementoKeyToNeverPromptExtensionAgain, []); + if (!list.includes(extensionId)) { list.push(extensionId); ``` [src/webviews/extension-side/extensionRecommendation.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/extensionRecommendation.node.ts) ```typescript - break; - } - default: - sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'dismissed' }); - } - } + break; + } + default: + sendTelemetryEvent(Telemetry.RecommendExtension, undefined, { extensionId, action: 'dismissed' }); + } + } } ``` @@ -3149,12 +3149,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) ```typescript - - case DataViewerMessages.RefreshDataViewer: - this.refreshData().ignoreErrors(); - void sendTelemetryEvent(Telemetry.RefreshDataViewer); - break; - + + case DataViewerMessages.RefreshDataViewer: + this.refreshData().ignoreErrors(); + void sendTelemetryEvent(Telemetry.RefreshDataViewer); + break; + case DataViewerMessages.SliceEnablementStateChanged: ``` @@ -3177,12 +3177,12 @@ No properties for event [src/notebooks/notebookCommandListener.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookCommandListener.ts) ```typescript - return; - } - - sendTelemetryEvent(Telemetry.RestartKernelCommand); - const kernel = this.kernelProvider.get(document.uri); - + return; + } + + sendTelemetryEvent(Telemetry.RestartKernelCommand); + const kernel = this.kernelProvider.get(document.uri); + if (kernel) { ``` @@ -3228,12 +3228,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - this.closeDocumentDisposable?.dispose(); // NOSONAR - this.updateRequiredDisposable?.dispose(); // NOSONAR - } - @captureTelemetry(Telemetry.RunAllCells) - public async runAllCells() { - const iw = await this.getActiveInteractiveWindow(); + this.closeDocumentDisposable?.dispose(); // NOSONAR + this.updateRequiredDisposable?.dispose(); // NOSONAR + } + @captureTelemetry(Telemetry.RunAllCells) + public async runAllCells() { + const iw = await this.getActiveInteractiveWindow(); const runCellCommands = this.codeLenses.filter( ``` @@ -3256,12 +3256,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - - // Run all cells up to the cell containing this start line and character - @captureTelemetry(Telemetry.RunAllCellsAbove) - public async runAllCellsAbove(stopLine: number, stopCharacter: number) { - const iw = await this.getActiveInteractiveWindow(); + } + + // Run all cells up to the cell containing this start line and character + @captureTelemetry(Telemetry.RunAllCellsAbove) + public async runAllCellsAbove(stopLine: number, stopCharacter: number) { + const iw = await this.getActiveInteractiveWindow(); const runCellCommands = this.codeLenses.filter((c) => c.command && c.command.command === Commands.RunCell); ``` @@ -3342,12 +3342,12 @@ No properties for event [src/kernels/variables/debuggerVariables.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/debuggerVariables.ts) ```typescript - // Note, full variable results isn't necessary for this call. It only really needs the variable value. - const result = this.lastKnownVariables.find((v) => v.name === name); - if (result && kernel?.resourceUri && uriPath.extname(kernel?.resourceUri).toLowerCase() === '.ipynb') { - sendTelemetryEvent(Telemetry.RunByLineVariableHover); - } - return result; + // Note, full variable results isn't necessary for this call. It only really needs the variable value. + const result = this.lastKnownVariables.find((v) => v.name === name); + if (result && kernel?.resourceUri && uriPath.extname(kernel?.resourceUri).toLowerCase() === '.ipynb') { + sendTelemetryEvent(Telemetry.RunByLineVariableHover); + } + return result; } ``` @@ -3389,12 +3389,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - await finished; - } - - @captureTelemetry(Telemetry.RunCellAndAllBelow) - public async runCellAndAllBelow(startLine: number, startCharacter: number) { - const iw = await this.getActiveInteractiveWindow(); + await finished; + } + + @captureTelemetry(Telemetry.RunCellAndAllBelow) + public async runCellAndAllBelow(startLine: number, startCharacter: number) { + const iw = await this.getActiveInteractiveWindow(); const runCellCommands = this.codeLenses.filter((c) => c.command && c.command.command === Commands.RunCell); ``` @@ -3417,12 +3417,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - }); - } - - @captureTelemetry(Telemetry.ChangeCellToCode) - public changeCellToCode() { - this.applyToCells((editor, cell, _) => { + }); + } + + @captureTelemetry(Telemetry.ChangeCellToCode) + public changeCellToCode() { + this.applyToCells((editor, cell, _) => { return this.changeCellTo(editor, cell, 'code'); ``` @@ -3445,12 +3445,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - await this.moveCellsDirection(false); - } - - @captureTelemetry(Telemetry.ChangeCellToMarkdown) - public changeCellToMarkdown() { - this.applyToCells((editor, cell, _) => { + await this.moveCellsDirection(false); + } + + @captureTelemetry(Telemetry.ChangeCellToMarkdown) + public changeCellToMarkdown() { + this.applyToCells((editor, cell, _) => { return this.changeCellTo(editor, cell, 'markdown'); ``` @@ -3473,12 +3473,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - return this.runMatchingCell(range, false, true); - } - - @captureTelemetry(Telemetry.RunCurrentCell) - public async runCurrentCell(): Promise { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { + return this.runMatchingCell(range, false, true); + } + + @captureTelemetry(Telemetry.RunCurrentCell) + public async runCurrentCell(): Promise { + if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { return; ``` @@ -3501,12 +3501,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.RunCurrentCellAndAddBelow) - public async runCurrentCellAndAddBelow(): Promise { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { + } + } + + @captureTelemetry(Telemetry.RunCurrentCellAndAddBelow) + public async runCurrentCellAndAddBelow(): Promise { + if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { return; ``` @@ -3529,12 +3529,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - return this.runMatchingCell(this.documentManager.activeTextEditor.selection, false); - } - - @captureTelemetry(Telemetry.RunCurrentCellAndAdvance) - public async runCurrentCellAndAdvance() { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { + return this.runMatchingCell(this.documentManager.activeTextEditor.selection, false); + } + + @captureTelemetry(Telemetry.RunCurrentCellAndAdvance) + public async runCurrentCellAndAdvance() { + if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { return; ``` @@ -3557,12 +3557,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.DeleteCells) - public deleteCells() { - const editor = this.documentManager.activeTextEditor; + } + } + + @captureTelemetry(Telemetry.DeleteCells) + public deleteCells() { + const editor = this.documentManager.activeTextEditor; if (!editor || !editor.selection) { ``` @@ -3585,12 +3585,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - editor.selections = selections; - } - - @captureTelemetry(Telemetry.ExtendSelectionByCellAbove) - public extendSelectionByCellAbove() { - // This behaves similarly to excel "Extend Selection by One Cell Above". + editor.selections = selections; + } + + @captureTelemetry(Telemetry.ExtendSelectionByCellAbove) + public extendSelectionByCellAbove() { + // This behaves similarly to excel "Extend Selection by One Cell Above". // The direction of the selection matters (i.e. where the active cursor) ``` @@ -3613,12 +3613,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.ExtendSelectionByCellBelow) - public extendSelectionByCellBelow() { - // This behaves similarly to excel "Extend Selection by One Cell Above". + } + } + + @captureTelemetry(Telemetry.ExtendSelectionByCellBelow) + public extendSelectionByCellBelow() { + // This behaves similarly to excel "Extend Selection by One Cell Above". // The direction of the selection matters (i.e. where the active cursor) ``` @@ -3641,24 +3641,24 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.RunFileInteractive) - public async runFileInteractive() { - return this.runFileInteractiveInternal(false); + } + } + + @captureTelemetry(Telemetry.RunFileInteractive) + public async runFileInteractive() { + return this.runFileInteractiveInternal(false); } ``` [src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) ```typescript - }; - - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.RunFileInteractive); - assertEvent(Telemetry.ExecuteCellPerceivedWarm); - assertEvent(Telemetry.SwitchKernel); + }; + + // Right now this is the guaranteed list. Might want to expand this. + assertEvent(Telemetry.RunFileInteractive); + assertEvent(Telemetry.ExecuteCellPerceivedWarm); + assertEvent(Telemetry.SwitchKernel); }); ``` @@ -3681,12 +3681,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.RunFromLine) - public async runFromLine(targetLine: number) { - if (this.document && targetLine < this.document.lineCount) { + } + } + + @captureTelemetry(Telemetry.RunFromLine) + public async runFromLine(targetLine: number) { + if (this.document && targetLine < this.document.lineCount) { const iw = await this.getActiveInteractiveWindow(); ``` @@ -3709,12 +3709,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.InsertCellAbove) - public insertCellAbove() { - const editor = this.documentManager.activeTextEditor; + } + } + + @captureTelemetry(Telemetry.InsertCellAbove) + public insertCellAbove() { + const editor = this.documentManager.activeTextEditor; if (editor && editor.selection) { ``` @@ -3737,12 +3737,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.InsertCellBelow) - public insertCellBelow() { - const editor = this.documentManager.activeTextEditor; + } + } + + @captureTelemetry(Telemetry.InsertCellBelow) + public insertCellBelow() { + const editor = this.documentManager.activeTextEditor; if (editor && editor.selection) { ``` @@ -3767,12 +3767,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - ); - } - - @captureTelemetry(Telemetry.InsertCellBelowPosition) - public insertCellBelowPosition() { - const editor = this.documentManager.activeTextEditor; + ); + } + + @captureTelemetry(Telemetry.InsertCellBelowPosition) + public insertCellBelowPosition() { + const editor = this.documentManager.activeTextEditor; if (editor && editor.selection) { ``` @@ -3795,12 +3795,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - await this.moveCellsDirection(true); - } - - @captureTelemetry(Telemetry.MoveCellsDown) - public async moveCellsDown(): Promise { - await this.moveCellsDirection(false); + await this.moveCellsDirection(true); + } + + @captureTelemetry(Telemetry.MoveCellsDown) + public async moveCellsDown(): Promise { + await this.moveCellsDirection(false); } ``` @@ -3823,12 +3823,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.MoveCellsUp) - public async moveCellsUp(): Promise { - await this.moveCellsDirection(true); + } + } + + @captureTelemetry(Telemetry.MoveCellsUp) + public async moveCellsUp(): Promise { + await this.moveCellsDirection(true); } ``` @@ -3851,12 +3851,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - .then(noop, noop); - } - - @captureTelemetry(Telemetry.SelectCell) - public selectCell() { - const editor = this.documentManager.activeTextEditor; + .then(noop, noop); + } + + @captureTelemetry(Telemetry.SelectCell) + public selectCell() { + const editor = this.documentManager.activeTextEditor; if (editor && editor.selection) { ``` @@ -3879,12 +3879,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.SelectCellContents) - public selectCellContents() { - const editor = this.documentManager.activeTextEditor; + } + } + + @captureTelemetry(Telemetry.SelectCellContents) + public selectCellContents() { + const editor = this.documentManager.activeTextEditor; if (!editor || !editor.selection) { ``` @@ -3907,12 +3907,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - await finished; - } - - @captureTelemetry(Telemetry.RunSelectionOrLine) - public async runSelectionOrLine(activeEditor: TextEditor | undefined, text?: string | Uri) { - if (this.document && activeEditor && urlPath.isEqual(activeEditor.document.uri, this.document.uri)) { + await finished; + } + + @captureTelemetry(Telemetry.RunSelectionOrLine) + public async runSelectionOrLine(activeEditor: TextEditor | undefined, text?: string | Uri) { + if (this.document && activeEditor && urlPath.isEqual(activeEditor.document.uri, this.document.uri)) { const iw = await this.getActiveInteractiveWindow(); ``` @@ -3935,12 +3935,12 @@ No properties for event [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.RunToLine) - public async runToLine(targetLine: number) { - if (this.document && targetLine > 0) { + } + } + + @captureTelemetry(Telemetry.RunToLine) + public async runToLine(targetLine: number) { + if (this.document && targetLine > 0) { const iw = await this.getActiveInteractiveWindow(); ``` @@ -4006,12 +4006,12 @@ No properties for event [src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.node.ts) ```typescript - public async activate(): Promise { - this.disposables.push( - this.cmdManager.registerCommand('jupyter.selectJupyterInterpreter', () => { - sendTelemetryEvent(Telemetry.SelectJupyterInterpreterCommand); - this.service.selectInterpreter().ignoreErrors(); - }) + public async activate(): Promise { + this.disposables.push( + this.cmdManager.registerCommand('jupyter.selectJupyterInterpreter', () => { + sendTelemetryEvent(Telemetry.SelectJupyterInterpreterCommand); + this.service.selectInterpreter().ignoreErrors(); + }) ); ``` @@ -4034,24 +4034,24 @@ No properties for event [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - @inject(IsWebExtension) private readonly isWebExtension: boolean - ) {} - - @captureTelemetry(Telemetry.SelectJupyterURI) - @traceDecoratorError('Failed to select Jupyter Uri') - public selectJupyterURI( + @inject(IsWebExtension) private readonly isWebExtension: boolean + ) {} + + @captureTelemetry(Telemetry.SelectJupyterURI) + @traceDecoratorError('Failed to select Jupyter Uri') + public selectJupyterURI( allowLocal: boolean, ``` [src/kernels/jupyter/launcher/commandLineSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/commandLineSelector.ts) ```typescript - workspaceService.onDidChangeConfiguration(this.onDidChangeConfiguration.bind(this)); - } - - @captureTelemetry(Telemetry.SelectJupyterURI) - public selectJupyterCommandLine(file: Uri): Promise { - const multiStep = this.multiStepFactory.create<{}>(); + workspaceService.onDidChangeConfiguration(this.onDidChangeConfiguration.bind(this)); + } + + @captureTelemetry(Telemetry.SelectJupyterURI) + public selectJupyterCommandLine(file: Uri): Promise { + const multiStep = this.multiStepFactory.create<{}>(); return multiStep.run(this.startSelectingCommandLine.bind(this, file), {}); ``` @@ -4074,12 +4074,12 @@ No properties for event [src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) ```typescript - // Else VSC is just setting a kernel for a notebook after it has opened. - if (existingKernel) { - const telemetryEvent = isLocalConnection(this.kernelConnection) - ? Telemetry.SelectLocalJupyterKernel - : Telemetry.SelectRemoteJupyterKernel; - sendKernelTelemetryEvent(document.uri, telemetryEvent); + // Else VSC is just setting a kernel for a notebook after it has opened. + if (existingKernel) { + const telemetryEvent = isLocalConnection(this.kernelConnection) + ? Telemetry.SelectLocalJupyterKernel + : Telemetry.SelectRemoteJupyterKernel; + sendKernelTelemetryEvent(document.uri, telemetryEvent); this.notebookApi.notebookEditors ``` @@ -4102,12 +4102,12 @@ No properties for event [src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) ```typescript - if (existingKernel) { - const telemetryEvent = isLocalConnection(this.kernelConnection) - ? Telemetry.SelectLocalJupyterKernel - : Telemetry.SelectRemoteJupyterKernel; - sendKernelTelemetryEvent(document.uri, telemetryEvent); - this.notebookApi.notebookEditors + if (existingKernel) { + const telemetryEvent = isLocalConnection(this.kernelConnection) + ? Telemetry.SelectLocalJupyterKernel + : Telemetry.SelectRemoteJupyterKernel; + sendKernelTelemetryEvent(document.uri, telemetryEvent); + this.notebookApi.notebookEditors .filter((editor) => editor.notebook === document) ``` @@ -4130,48 +4130,48 @@ No properties for event [src/kernels/jupyter/jupyterUtils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterUtils.ts) ```typescript - await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); - return true; - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - return false; + await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); + return true; + } else if (value === closeOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageClose); + } + return false; } ``` [src/kernels/jupyter/jupyterUtils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterUtils.ts) ```typescript - await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); - return true; - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - return false; + await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); + return true; + } else if (value === closeOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageClose); + } + return false; } ``` [src/kernels/errors/kernelErrorHandler.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/errors/kernelErrorHandler.ts) ```typescript - ) - .catch(noop); - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - }) + ) + .catch(noop); + } else if (value === closeOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageClose); + } + }) .then(noop, noop); ``` [src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) ```typescript - ); - return this.requestCreator.getFetchMethod()(url, this.addAllowUnauthorized(url, true, options)); - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - } + ); + return this.requestCreator.getFetchMethod()(url, this.addAllowUnauthorized(url, true, options)); + } else if (value === closeOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageClose); + } + } throw e; ``` @@ -4194,48 +4194,48 @@ No properties for event [src/kernels/jupyter/jupyterUtils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterUtils.ts) ```typescript - closeOption - ); - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); - return true; + closeOption + ); + if (value === enableOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); + await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); + return true; } else if (value === closeOption) { ``` [src/kernels/jupyter/jupyterUtils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterUtils.ts) ```typescript - closeOption - ); - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); - return true; + closeOption + ); + if (value === enableOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); + await config.updateSetting('allowUnauthorizedRemoteConnection', true, undefined, ConfigurationTarget.Workspace); + return true; } else if (value === closeOption) { ``` [src/kernels/errors/kernelErrorHandler.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/errors/kernelErrorHandler.ts) ```typescript - .showErrorMessage(DataScience.jupyterSelfCertFail().format(err.message), enableOption, closeOption) - .then((value) => { - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - this.configuration - .updateSetting( + .showErrorMessage(DataScience.jupyterSelfCertFail().format(err.message), enableOption, closeOption) + .then((value) => { + if (value === enableOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); + this.configuration + .updateSetting( 'allowUnauthorizedRemoteConnection', ``` [src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) ```typescript - closeOption - ); - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - await this.configService.updateSetting( - 'allowUnauthorizedRemoteConnection', + closeOption + ); + if (value === enableOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); + await this.configService.updateSetting( + 'allowUnauthorizedRemoteConnection', true, ``` @@ -4258,12 +4258,12 @@ No properties for event [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - return computeServerId(uri); - } - } - @captureTelemetry(Telemetry.SetJupyterURIToLocal) - public async setJupyterURIToLocal(): Promise { - await this.serverUriStorage.setUriToLocal(); + return computeServerId(uri); + } + } + @captureTelemetry(Telemetry.SetJupyterURIToLocal) + public async setJupyterURIToLocal(): Promise { + await this.serverUriStorage.setUriToLocal(); } ``` @@ -4288,12 +4288,12 @@ No properties for event [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - allowLocal: boolean, - commandSource: SelectJupyterUriCommandSource = 'nonUser' - ): Promise { - sendTelemetryEvent(Telemetry.SetJupyterURIUIDisplayed, undefined, { - commandSource - }); + allowLocal: boolean, + commandSource: SelectJupyterUriCommandSource = 'nonUser' + ): Promise { + sendTelemetryEvent(Telemetry.SetJupyterURIUIDisplayed, undefined, { + commandSource + }); const multiStep = this.multiStepFactory.create<{}>(); ``` @@ -4308,19 +4308,19 @@ No description provided ## Properties -- +- azure: boolean; ## Locations Used [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - await this.serverUriStorage.setUriToRemote(userURI, connection.displayName); - - // Indicate setting a jupyter URI to a remote setting. Check if an azure remote or not - sendTelemetryEvent(Telemetry.SetJupyterURIToUserSpecified, undefined, { - azure: userURI.toLowerCase().includes('azure') - }); + await this.serverUriStorage.setUriToRemote(userURI, connection.displayName); + + // Indicate setting a jupyter URI to a remote setting. Check if an azure remote or not + sendTelemetryEvent(Telemetry.SetJupyterURIToUserSpecified, undefined, { + azure: userURI.toLowerCase().includes('azure') + }); } ``` @@ -4342,24 +4342,24 @@ No description provided [src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) ```typescript - - // Log telemetry about number of rows - try { - sendTelemetryEvent(Telemetry.ShowDataViewer, 0, { - rows: output.rowCount ? output.rowCount : 0, - columns: output.columns ? output.columns.length : 0 + + // Log telemetry about number of rows + try { + sendTelemetryEvent(Telemetry.ShowDataViewer, 0, { + rows: output.rowCount ? output.rowCount : 0, + columns: output.columns ? output.columns.length : 0 }); ``` [src/webviews/extension-side/dataviewer/dataViewer.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewer.node.ts) ```typescript - - private sendElapsedTimeTelemetry() { - if (this.rowsTimer && this.pendingRowsCount === 0) { - sendTelemetryEvent(Telemetry.ShowDataViewer, this.rowsTimer.elapsedTime); - } - } + + private sendElapsedTimeTelemetry() { + if (this.rowsTimer && this.pendingRowsCount === 0) { + sendTelemetryEvent(Telemetry.ShowDataViewer, this.rowsTimer.elapsedTime); + } + } ``` @@ -4382,12 +4382,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewerFactory.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerFactory.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.StartShowDataViewer) - public async create(dataProvider: IDataViewerDataProvider, title: string): Promise { - let result: IDataViewer | undefined; + } + } + + @captureTelemetry(Telemetry.StartShowDataViewer) + public async create(dataProvider: IDataViewerDataProvider, title: string): Promise { + let result: IDataViewer | undefined; ``` @@ -4448,36 +4448,36 @@ No properties for event [src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) ```typescript - } - - case DataScience.selectDifferentJupyterInterpreter(): { - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.selectAnotherInterpreter; - } + } + + case DataScience.selectDifferentJupyterInterpreter(): { + sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); + return JupyterInterpreterDependencyResponse.selectAnotherInterpreter; + } ``` [src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) ```typescript - - case DataScience.pythonInteractiveHelpLink(): { - this.applicationShell.openUrl(HelpLinks.PythonInteractiveHelpLink); - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.cancel; - } + + case DataScience.pythonInteractiveHelpLink(): { + this.applicationShell.openUrl(HelpLinks.PythonInteractiveHelpLink); + sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); + return JupyterInterpreterDependencyResponse.cancel; + } ``` [src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) ```typescript - } - - default: - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.cancel; - } + } + + default: + sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); + return JupyterInterpreterDependencyResponse.cancel; + } } finally { ``` @@ -4500,12 +4500,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) ```typescript - sendTelemetryEvent(Telemetry.UserInstalledPandas); - } - } else { - sendTelemetryEvent(Telemetry.UserDidNotInstallPandas); - throw new Error(DataScience.pandasRequiredForViewing()); - } + sendTelemetryEvent(Telemetry.UserInstalledPandas); + } + } else { + sendTelemetryEvent(Telemetry.UserDidNotInstallPandas); + throw new Error(DataScience.pandasRequiredForViewing()); + } } ``` @@ -4528,12 +4528,12 @@ No properties for event [src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) ```typescript - return JupyterInterpreterDependencyResponse.cancel; - } - } - sendTelemetryEvent(Telemetry.UserInstalledJupyter); - - // Check if kernelspec module is something that accessible. + return JupyterInterpreterDependencyResponse.cancel; + } + } + sendTelemetryEvent(Telemetry.UserInstalledJupyter); + + // Check if kernelspec module is something that accessible. return this.checkKernelSpecAvailability(interpreter); ``` @@ -4580,12 +4580,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) ```typescript - cancellationPromise - ]); - if (response === InstallerResponse.Installed) { - sendTelemetryEvent(Telemetry.UserInstalledPandas); - } - } else { + cancellationPromise + ]); + if (response === InstallerResponse.Installed) { + sendTelemetryEvent(Telemetry.UserInstalledPandas); + } + } else { sendTelemetryEvent(Telemetry.UserDidNotInstallPandas); ``` @@ -4600,21 +4600,21 @@ No description provided ## Properties -- +- ename: string; -- +- evalue: string; ## Locations Used [src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) ```typescript - await this.executeSilently(session, this.getUserStartupCommands(), { - traceErrors: true, - traceErrorsMessage: 'Error executing user defined startup code', - telemetryName: Telemetry.UserStartupCodeFailure - }); - } + await this.executeSilently(session, this.getUserStartupCommands(), { + traceErrors: true, + traceErrorsMessage: 'Error executing user defined startup code', + telemetryName: Telemetry.UserStartupCodeFailure + }); + } ``` @@ -4743,24 +4743,24 @@ No description provided ## Properties -- - /** - * Whether this is the first time in the session. - * (fetching kernels first time in the session is slower, later its cached). - * This is a generic property supported for all telemetry (sent by decorators). - */ +- + /** + * Whether this is the first time in the session. + * (fetching kernels first time in the session is slower, later its cached). + * This is a generic property supported for all telemetry (sent by decorators). + */ firstTime?: boolean; ## Locations Used [src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) ```typescript - } - } - private workspaceCachedActiveInterpreter = new Map>(); - @captureTelemetry(Telemetry.ActiveInterpreterListingPerf) - @traceDecoratorVerbose('Get Active Interpreter', TraceOptions.Arguments | TraceOptions.BeforeCall) - public getActiveInterpreter(resource?: Uri): Promise { + } + } + private workspaceCachedActiveInterpreter = new Map>(); + @captureTelemetry(Telemetry.ActiveInterpreterListingPerf) + @traceDecoratorVerbose('Get Active Interpreter', TraceOptions.Arguments | TraceOptions.BeforeCall) + public getActiveInterpreter(resource?: Uri): Promise { this.hookupOnDidChangeInterpreterEvent(); ``` @@ -4821,12 +4821,12 @@ No properties for event [src/interactive-window/editor-integration/codelensprovider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codelensprovider.ts) ```typescript - // On shutdown send how long on average we spent parsing code lens - if (this.totalGetCodeLensCalls > 0) { - sendTelemetryEvent( - Telemetry.CodeLensAverageAcquisitionTime, - this.totalExecutionTimeInMs / this.totalGetCodeLensCalls - ); + // On shutdown send how long on average we spent parsing code lens + if (this.totalGetCodeLensCalls > 0) { + sendTelemetryEvent( + Telemetry.CodeLensAverageAcquisitionTime, + this.totalExecutionTimeInMs / this.totalGetCodeLensCalls + ); } ``` @@ -4851,36 +4851,36 @@ No properties for event [src/platform/common/application/commandManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts) ```typescript - return commands.registerCommand( - command, - (...args: U) => { - sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); - if (thisArg) { - return callback.call(thisArg, ...(args as any)); + return commands.registerCommand( + command, + (...args: U) => { + sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); + if (thisArg) { + return callback.call(thisArg, ...(args as any)); } else { ``` [src/platform/common/application/commandManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts) ```typescript - return commands.registerTextEditorCommand( - command, - (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => { - sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); - if (thisArg) { - return callback.call(thisArg, textEditor, edit, ...args); + return commands.registerTextEditorCommand( + command, + (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => { + sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); + if (thisArg) { + return callback.call(thisArg, textEditor, edit, ...args); } else { ``` [src/platform/common/application/commandManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts) ```typescript - U extends ICommandNameArgumentTypeMapping[E] - >(command: E, ...rest: U): Thenable { - if (!commandsToIgnore.has(command)) { - sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); - } - return commands.executeCommand(command, ...rest); + U extends ICommandNameArgumentTypeMapping[E] + >(command: E, ...rest: U): Thenable { + if (!commandsToIgnore.has(command)) { + sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); + } + return commands.executeCommand(command, ...rest); } ``` @@ -4953,12 +4953,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) ```typescript - throw new RemoteJupyterServerConnectionError(connection.baseUrl, options.serverId, err); - } - } else { - sendTelemetryEvent(Telemetry.ConnectFailedJupyter, undefined, undefined, err, true); - throw new LocalJupyterServerConnectionError(err); - } + throw new RemoteJupyterServerConnectionError(connection.baseUrl, options.serverId, err); + } + } else { + sendTelemetryEvent(Telemetry.ConnectFailedJupyter, undefined, undefined, err, true); + throw new LocalJupyterServerConnectionError(err); + } } else { ``` @@ -4981,12 +4981,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) ```typescript - traceInfo(`Connection complete server`); - - sendTelemetryEvent( - options.localJupyter ? Telemetry.ConnectLocalJupyter : Telemetry.ConnectRemoteJupyter - ); - return result; + traceInfo(`Connection complete server`); + + sendTelemetryEvent( + options.localJupyter ? Telemetry.ConnectLocalJupyter : Telemetry.ConnectRemoteJupyter + ); + return result; } catch (err) { ``` @@ -5011,12 +5011,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) ```typescript - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - throw new JupyterSelfCertsError(connection.baseUrl); - } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteExpiredCertFailedJupyter); - throw new JupyterSelfCertsExpiredError(connection.baseUrl); - } else { + sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); + throw new JupyterSelfCertsError(connection.baseUrl); + } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { + sendTelemetryEvent(Telemetry.ConnectRemoteExpiredCertFailedJupyter); + throw new JupyterSelfCertsExpiredError(connection.baseUrl); + } else { throw new RemoteJupyterServerConnectionError(connection.baseUrl, options.serverId, err); ``` @@ -5039,12 +5039,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) ```typescript - - // Something else went wrong - if (!options.localJupyter) { - sendTelemetryEvent(Telemetry.ConnectRemoteFailedJupyter, undefined, undefined, err, true); - - // Check for the self signed certs error specifically + + // Something else went wrong + if (!options.localJupyter) { + sendTelemetryEvent(Telemetry.ConnectRemoteFailedJupyter, undefined, undefined, err, true); + + // Check for the self signed certs error specifically if (JupyterSelfCertsError.isSelfCertsError(err)) { ``` @@ -5067,12 +5067,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) ```typescript - traceInfo(`Connection complete server`); - - sendTelemetryEvent( - options.localJupyter ? Telemetry.ConnectLocalJupyter : Telemetry.ConnectRemoteJupyter - ); - return result; + traceInfo(`Connection complete server`); + + sendTelemetryEvent( + options.localJupyter ? Telemetry.ConnectLocalJupyter : Telemetry.ConnectRemoteJupyter + ); + return result; } catch (err) { ``` @@ -5097,12 +5097,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) ```typescript - connection = await this.startOrConnect(options, cancelToken); - - if (!connection.localLaunch && LocalHosts.includes(connection.hostName.toLowerCase())) { - sendTelemetryEvent(Telemetry.ConnectRemoteJupyterViaLocalHost); - } - // eslint-disable-next-line no-constant-condition + connection = await this.startOrConnect(options, cancelToken); + + if (!connection.localLaunch && LocalHosts.includes(connection.hostName.toLowerCase())) { + sendTelemetryEvent(Telemetry.ConnectRemoteJupyterViaLocalHost); + } + // eslint-disable-next-line no-constant-condition traceInfo(`Connecting to process server`); ``` @@ -5127,60 +5127,60 @@ No properties for event [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - } - } catch (err) { - if (JupyterSelfCertsError.isSelfCertsError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - const handled = await handleSelfCertsError(this.applicationShell, this.configService, err.message); - if (!handled) { + } + } catch (err) { + if (JupyterSelfCertsError.isSelfCertsError(err)) { + sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); + const handled = await handleSelfCertsError(this.applicationShell, this.configService, err.message); + if (!handled) { return; ``` [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - return; - } - } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - const handled = await handleExpiredCertsError(this.applicationShell, this.configService, err.message); - if (!handled) { + return; + } + } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { + sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); + const handled = await handleExpiredCertsError(this.applicationShell, this.configService, err.message); + if (!handled) { return; ``` [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - } catch (err) { - traceWarning('Uri verification error', err); - if (JupyterSelfCertsError.isSelfCertsError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - const handled = await handleSelfCertsError(this.applicationShell, this.configService, err.message); - if (!handled) { + } catch (err) { + traceWarning('Uri verification error', err); + if (JupyterSelfCertsError.isSelfCertsError(err)) { + sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); + const handled = await handleSelfCertsError(this.applicationShell, this.configService, err.message); + if (!handled) { return DataScience.jupyterSelfCertFailErrorMessageOnly(); ``` [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - return DataScience.jupyterSelfCertFailErrorMessageOnly(); - } - } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - const handled = await handleExpiredCertsError(this.applicationShell, this.configService, err.message); - if (!handled) { + return DataScience.jupyterSelfCertFailErrorMessageOnly(); + } + } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { + sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); + const handled = await handleExpiredCertsError(this.applicationShell, this.configService, err.message); + if (!handled) { return DataScience.jupyterSelfCertExpiredErrorMessageOnly(); ``` [src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) ```typescript - - // Check for the self signed certs error specifically - if (JupyterSelfCertsError.isSelfCertsError(err)) { - sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); - throw new JupyterSelfCertsError(connection.baseUrl); - } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { + + // Check for the self signed certs error specifically + if (JupyterSelfCertsError.isSelfCertsError(err)) { + sendTelemetryEvent(Telemetry.ConnectRemoteSelfCertFailedJupyter); + throw new JupyterSelfCertsError(connection.baseUrl); + } else if (JupyterSelfCertsExpiredError.isSelfCertsExpiredError(err)) { sendTelemetryEvent(Telemetry.ConnectRemoteExpiredCertFailedJupyter); ``` @@ -5197,24 +5197,24 @@ No properties for event ## Properties -- - /** - * Indicates whether the python extension is installed. - * If we send telemetry fro this & this is `true`, then we have a bug. - * If its `false`, then we can ignore this telemetry. - */ +- + /** + * Indicates whether the python extension is installed. + * If we send telemetry fro this & this is `true`, then we have a bug. + * If its `false`, then we can ignore this telemetry. + */ pythonExtensionInstalled: boolean; ## Locations Used [src/kernels/raw/session/hostRawNotebookProvider.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/hostRawNotebookProvider.node.ts) ```typescript - kernelConnection.kind === 'startUsingLocalKernelSpec' - ) { - if (!kernelConnection.interpreter) { - sendTelemetryEvent(Telemetry.AttemptedToLaunchRawKernelWithoutInterpreter, undefined, { - pythonExtensionInstalled: this.extensionChecker.isPythonExtensionInstalled - }); + kernelConnection.kind === 'startUsingLocalKernelSpec' + ) { + if (!kernelConnection.interpreter) { + sendTelemetryEvent(Telemetry.AttemptedToLaunchRawKernelWithoutInterpreter, undefined, { + pythonExtensionInstalled: this.extensionChecker.isPythonExtensionInstalled + }); } ``` @@ -5240,24 +5240,24 @@ No properties for event [src/kernels/execution/cellExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/cellExecution.ts) ```typescript - const props = { notebook: true }; - if (!CellExecution.sentExecuteCellTelemetry) { - CellExecution.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props); - } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatchForTelemetry.elapsedTime, props); + const props = { notebook: true }; + if (!CellExecution.sentExecuteCellTelemetry) { + CellExecution.sentExecuteCellTelemetry = true; + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props); + } else { + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatchForTelemetry.elapsedTime, props); } ``` [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - if (runningStopWatch) { - if (!CodeWatcher.sentExecuteCellTelemetry) { - CodeWatcher.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, runningStopWatch.elapsedTime); - } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, runningStopWatch.elapsedTime); + if (runningStopWatch) { + if (!CodeWatcher.sentExecuteCellTelemetry) { + CodeWatcher.sentExecuteCellTelemetry = true; + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, runningStopWatch.elapsedTime); + } else { + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, runningStopWatch.elapsedTime); } ``` @@ -5283,36 +5283,36 @@ No properties for event [src/kernels/execution/cellExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/cellExecution.ts) ```typescript - CellExecution.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props); - } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatchForTelemetry.elapsedTime, props); - } - } + CellExecution.sentExecuteCellTelemetry = true; + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props); + } else { + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatchForTelemetry.elapsedTime, props); + } + } private canExecuteCell() { ``` [src/interactive-window/editor-integration/codewatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts) ```typescript - CodeWatcher.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, runningStopWatch.elapsedTime); - } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, runningStopWatch.elapsedTime); - } - } + CodeWatcher.sentExecuteCellTelemetry = true; + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, runningStopWatch.elapsedTime); + } else { + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, runningStopWatch.elapsedTime); + } + } } ``` [src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) ```typescript - - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.RunFileInteractive); - assertEvent(Telemetry.ExecuteCellPerceivedWarm); - assertEvent(Telemetry.SwitchKernel); - }); + + // Right now this is the guaranteed list. Might want to expand this. + assertEvent(Telemetry.RunFileInteractive); + assertEvent(Telemetry.ExecuteCellPerceivedWarm); + assertEvent(Telemetry.SwitchKernel); + }); }); ``` @@ -5335,24 +5335,24 @@ No properties for event [src/kernels/jupyter/jupyterKernelService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.node.ts) ```typescript - await this.fs.writeLocalFile(kernelSpecFilePath.fsPath, JSON.stringify(contents, undefined, 4)); - } catch (ex) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendTelemetryEvent(Telemetry.FailedToUpdateKernelSpec, undefined, undefined, ex as any, true); - throw ex; - } + await this.fs.writeLocalFile(kernelSpecFilePath.fsPath, JSON.stringify(contents, undefined, 4)); + } catch (ex) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + sendTelemetryEvent(Telemetry.FailedToUpdateKernelSpec, undefined, undefined, ex as any, true); + throw ex; + } if (cancelToken.isCancellationRequested) { ``` [src/kernels/jupyter/jupyterKernelService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.node.ts) ```typescript - await this.fs.writeLocalFile(kernelSpecFilePath, JSON.stringify(specModel, undefined, 2)); - } catch (ex) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendTelemetryEvent(Telemetry.FailedToUpdateKernelSpec, undefined, undefined, ex as any, true); - throw ex; - } + await this.fs.writeLocalFile(kernelSpecFilePath, JSON.stringify(specModel, undefined, 2)); + } catch (ex) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + sendTelemetryEvent(Telemetry.FailedToUpdateKernelSpec, undefined, undefined, ex as any, true); + throw ex; + } } ``` @@ -5441,84 +5441,84 @@ No properties for event [src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) ```typescript - ]); - - const envType = interpreter.envType; - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, + ]); + + const envType = interpreter.envType; + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, source: 'python', ``` [src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) ```typescript - interpreter?.uri - )}, shell cannot be determined.` - ); - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, 0, { - envType, - pythonEnvType: envType, + interpreter?.uri + )}, shell cannot be determined.` + ); + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, 0, { + envType, + pythonEnvType: envType, source: 'jupyter', ``` [src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) ```typescript - const stopWatch = new StopWatch(); - try { - const env = await this.getCondaEnvVariables(resource, interpreter); - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, + const stopWatch = new StopWatch(); + try { + const env = await this.getCondaEnvVariables(resource, interpreter); + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, source: 'jupyter', ``` [src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) ```typescript - }); - return env; - } catch (ex) { - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, + }); + return env; + } catch (ex) { + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, source: 'jupyter', ``` [src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) ```typescript - const processService = await processServicePromise; - const hasCustomEnvVars = Object.keys(customEnvVars).length; - if (!activationCommands || activationCommands.length === 0) { - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, + const processService = await processServicePromise; + const hasCustomEnvVars = Object.keys(customEnvVars).length; + if (!activationCommands || activationCommands.length === 0) { + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, source: 'jupyter', ``` [src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) ```typescript - } else if (returnedEnv) { - delete returnedEnv[PYTHON_WARNINGS]; - } - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, + } else if (returnedEnv) { + delete returnedEnv[PYTHON_WARNINGS]; + } + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, source: 'jupyter', ``` [src/platform/common/process/environmentActivationService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.node.ts) ```typescript - - return returnedEnv; - } catch (e) { - sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { - envType, - pythonEnvType: envType, + + return returnedEnv; + } catch (e) { + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, source: 'jupyter', ``` @@ -5541,12 +5541,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) ```typescript - const requestHeaders = { Cookie: cookieString, 'X-XSRFToken': xsrfCookie }; - return { requestHeaders }; - } else { - sendTelemetryEvent(Telemetry.GetPasswordFailure); - return undefined; - } + const requestHeaders = { Cookie: cookieString, 'X-XSRFToken': xsrfCookie }; + return { requestHeaders }; + } else { + sendTelemetryEvent(Telemetry.GetPasswordFailure); + return undefined; + } } ``` @@ -5569,12 +5569,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterPasswordConnect.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts) ```typescript - - // If we found everything return it all back if not, undefined as partial is useless - if (xsrfCookie && sessionCookieName && sessionCookieValue) { - sendTelemetryEvent(Telemetry.GetPasswordSuccess); - const cookieString = this.getSessionCookieString(xsrfCookie, sessionCookieName, sessionCookieValue); - const requestHeaders = { Cookie: cookieString, 'X-XSRFToken': xsrfCookie }; + + // If we found everything return it all back if not, undefined as partial is useless + if (xsrfCookie && sessionCookieName && sessionCookieValue) { + sendTelemetryEvent(Telemetry.GetPasswordSuccess); + const cookieString = this.getSessionCookieString(xsrfCookie, sessionCookieName, sessionCookieValue); + const requestHeaders = { Cookie: cookieString, 'X-XSRFToken': xsrfCookie }; return { requestHeaders }; ``` @@ -5629,50 +5629,50 @@ No description provided ## Properties -- - /** - * Hash of the cell output mimetype - * - * @type {string} - */ +- + /** + * Hash of the cell output mimetype + * + * @type {string} + */ hashedName: string; -- +- hasText: boolean; -- +- hasLatex: boolean; -- +- hasHtml: boolean; -- +- hasSvg: boolean; -- +- hasXml: boolean; -- +- hasJson: boolean; -- +- hasImage: boolean; -- +- hasGeo: boolean; -- +- hasPlotly: boolean; -- +- hasVega: boolean; -- +- hasWidget: boolean; -- +- hasJupyter: boolean; -- +- hasVnd: boolean; ## Locations Used [src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts) ```typescript - hasJupyter: lowerMimeType.includes('jupyter'), - hasVnd: lowerMimeType.includes('vnd') - }; - sendTelemetryEvent(Telemetry.HashedCellOutputMimeType, undefined, props); - } -} + hasJupyter: lowerMimeType.includes('jupyter'), + hasVnd: lowerMimeType.includes('vnd') + }; + sendTelemetryEvent(Telemetry.HashedCellOutputMimeType, undefined, props); + } +} ``` @@ -5695,12 +5695,12 @@ No properties for event [src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts) ```typescript - this.pendingChecks.set(id, setTimeout(check, 5000)); - } - - @captureTelemetry(Telemetry.HashedCellOutputMimeTypePerf) - private checkCell(cell: NotebookCell) { - this.pendingChecks.delete(cell.document.uri.toString()); + this.pendingChecks.set(id, setTimeout(check, 5000)); + } + + @captureTelemetry(Telemetry.HashedCellOutputMimeTypePerf) + private checkCell(cell: NotebookCell) { + this.pendingChecks.delete(cell.document.uri.toString()); this.getCellOutputMimeTypes(cell).forEach(this.sendTelemetry.bind(this)); ``` @@ -5735,20 +5735,20 @@ Event can be removed. Not referenced anywhere ## Properties -- - // Result is null if user signalled cancellation or if we timed out +- + // Result is null if user signalled cancellation or if we timed out isResultNull: boolean; ## Locations Used [src/interactive-window/editor-integration/hoverProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/hoverProvider.ts) ```typescript - const timeoutHandler = sleep(300).then(() => undefined); - this.stopWatch.reset(); - const result = await Promise.race([timeoutHandler, this.getVariableHover(document, position, token)]); - sendTelemetryEvent(Telemetry.InteractiveFileTooltipsPerf, this.stopWatch.elapsedTime, { - isResultNull: !!result - }); + const timeoutHandler = sleep(300).then(() => undefined); + this.stopWatch.reset(); + const result = await Promise.race([timeoutHandler, this.getVariableHover(document, position, token)]); + sendTelemetryEvent(Telemetry.InteractiveFileTooltipsPerf, this.stopWatch.elapsedTime, { + isResultNull: !!result + }); return result; ``` @@ -5773,12 +5773,12 @@ No properties for event [src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) ```typescript - return this.didChangeInterpreters.event; - } - - @captureTelemetry(Telemetry.InterpreterListingPerf) - @traceDecoratorVerbose('Get Interpreters', TraceOptions.Arguments | TraceOptions.BeforeCall) - public getInterpreters(resource?: Uri): Promise { + return this.didChangeInterpreters.event; + } + + @captureTelemetry(Telemetry.InterpreterListingPerf) + @traceDecoratorVerbose('Get Interpreters', TraceOptions.Arguments | TraceOptions.BeforeCall) + public getInterpreters(resource?: Uri): Promise { this.hookupOnDidChangeInterpreterEvent(); ``` @@ -5801,12 +5801,12 @@ No properties for event [src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) ```typescript - return newCellExecutionQueue; - } - @captureTelemetry(Telemetry.Interrupt) - @captureTelemetry(Telemetry.InterruptJupyterTime) - private async interruptExecution( - session: IJupyterSession, + return newCellExecutionQueue; + } + @captureTelemetry(Telemetry.Interrupt) + @captureTelemetry(Telemetry.InterruptJupyterTime) + private async interruptExecution( + session: IJupyterSession, pendingCells: Promise ``` @@ -5833,12 +5833,12 @@ No properties for event [src/kernels/errors/jupyterInvalidKernelError.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/errors/jupyterInvalidKernelError.ts) ```typescript - DataScience.kernelInvalid().format(getDisplayNameOrNameOfKernelConnection(kernelConnectionMetadata)), - kernelConnectionMetadata - ); - sendTelemetryEvent(Telemetry.KernelInvalid); - } -} + DataScience.kernelInvalid().format(getDisplayNameOrNameOfKernelConnection(kernelConnectionMetadata)), + kernelConnectionMetadata + ); + sendTelemetryEvent(Telemetry.KernelInvalid); + } +} ``` @@ -5864,12 +5864,12 @@ No properties for event [src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts) ```typescript - delete config['@jupyter-widgets/controls']; - delete config['@jupyter-widgets/output']; - } - sendTelemetryEvent(Telemetry.DiscoverIPyWidgetNamesPerf, stopWatch.elapsedTime, { - type: isLocalConnection(this.kernel.kernelConnectionMetadata) ? 'local' : 'remote' - }); + delete config['@jupyter-widgets/controls']; + delete config['@jupyter-widgets/output']; + } + sendTelemetryEvent(Telemetry.DiscoverIPyWidgetNamesPerf, stopWatch.elapsedTime, { + type: isLocalConnection(this.kernel.kernelConnectionMetadata) ? 'local' : 'remote' + }); return config && Object.keys(config).length ? config : undefined; ``` @@ -5915,12 +5915,12 @@ No properties for event [src/kernels/ipywidgets/ipyWidgetScriptSource.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/ipyWidgetScriptSource.ts) ```typescript - } - } catch (ex) { - traceError('Failed to get widget source due to an error', ex); - sendTelemetryEvent(Telemetry.HashedIPyWidgetScriptDiscoveryError); - } finally { - traceInfo( + } + } catch (ex) { + traceError('Failed to get widget source due to an error', ex); + sendTelemetryEvent(Telemetry.HashedIPyWidgetScriptDiscoveryError); + } finally { + traceInfo( `${ConsoleForegroundColors.Green}Script for ${moduleName}, is ${widgetSource.scriptUri} from ${widgetSource.source}` ``` @@ -5946,48 +5946,48 @@ No properties for event [src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts) ```typescript - } - - if (indexOfRequireConfig < 0) { - sendTelemetryEvent(Telemetry.IPyWidgetExtensionJsInfo, undefined, { - widgetFolderNameHash, - failed: true, + } + + if (indexOfRequireConfig < 0) { + sendTelemetryEvent(Telemetry.IPyWidgetExtensionJsInfo, undefined, { + widgetFolderNameHash, + failed: true, patternUsedToRegisterRequireConfig, ``` [src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts) ```typescript - // Find the end bracket for the require config call. - const endBracket = contents.indexOf(')', indexOfRequireConfig); - if (endBracket <= 0 || !patternUsedToRegisterRequireConfig) { - sendTelemetryEvent(Telemetry.IPyWidgetExtensionJsInfo, undefined, { - widgetFolderNameHash, - failed: true, + // Find the end bracket for the require config call. + const endBracket = contents.indexOf(')', indexOfRequireConfig); + if (endBracket <= 0 || !patternUsedToRegisterRequireConfig) { + sendTelemetryEvent(Telemetry.IPyWidgetExtensionJsInfo, undefined, { + widgetFolderNameHash, + failed: true, patternUsedToRegisterRequireConfig, ``` [src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts) ```typescript - }); - - if (!requireConfig || !Object.keys(requireConfig).length) { - sendTelemetryEvent(Telemetry.IPyWidgetExtensionJsInfo, undefined, { - widgetFolderNameHash, - failed: true, + }); + + if (!requireConfig || !Object.keys(requireConfig).length) { + sendTelemetryEvent(Telemetry.IPyWidgetExtensionJsInfo, undefined, { + widgetFolderNameHash, + failed: true, patternUsedToRegisterRequireConfig, ``` [src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/baseIPyWidgetScriptManager.ts) ```typescript - }); - return; - } - sendTelemetryEvent(Telemetry.IPyWidgetExtensionJsInfo, undefined, { - widgetFolderNameHash, - patternUsedToRegisterRequireConfig, + }); + return; + } + sendTelemetryEvent(Telemetry.IPyWidgetExtensionJsInfo, undefined, { + widgetFolderNameHash, + patternUsedToRegisterRequireConfig, requireEntryPointCount: Object.keys(requireConfig).length ``` @@ -6033,12 +6033,12 @@ No properties for event [src/kernels/ipywidgets/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/commonMessageCoordinator.ts) ```typescript - } - traceError(`Widget load failure ${errorMessage}`, payload); - - sendTelemetryEvent(Telemetry.IPyWidgetLoadFailure, 0, { - isOnline: payload.isOnline, - moduleHash: getTelemetrySafeHashedString(payload.moduleName), + } + traceError(`Widget load failure ${errorMessage}`, payload); + + sendTelemetryEvent(Telemetry.IPyWidgetLoadFailure, 0, { + isOnline: payload.isOnline, + moduleHash: getTelemetrySafeHashedString(payload.moduleName), moduleVersion: payload.moduleVersion, ``` @@ -6063,12 +6063,12 @@ No properties for event [src/kernels/ipywidgets/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/commonMessageCoordinator.ts) ```typescript - - private sendLoadSucceededTelemetry(payload: LoadIPyWidgetClassLoadAction) { - try { - sendTelemetryEvent(Telemetry.IPyWidgetLoadSuccess, 0, { - moduleHash: getTelemetrySafeHashedString(payload.moduleName), - moduleVersion: payload.moduleVersion + + private sendLoadSucceededTelemetry(payload: LoadIPyWidgetClassLoadAction) { + try { + sendTelemetryEvent(Telemetry.IPyWidgetLoadSuccess, 0, { + moduleHash: getTelemetrySafeHashedString(payload.moduleName), + moduleVersion: payload.moduleVersion }); ``` @@ -6093,12 +6093,12 @@ No properties for event [src/kernels/ipywidgets/ipyWidgetMessageDispatcher.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/ipyWidgetMessageDispatcher.ts) ```typescript - } - - private sendOverheadTelemetry() { - sendTelemetryEvent(Telemetry.IPyWidgetOverhead, 0, { - totalOverheadInMs: this.totalWaitTime, - numberOfMessagesWaitedOn: this.totalWaitedMessages, + } + + private sendOverheadTelemetry() { + sendTelemetryEvent(Telemetry.IPyWidgetOverhead, 0, { + totalOverheadInMs: this.totalWaitTime, + numberOfMessagesWaitedOn: this.totalWaitedMessages, averageWaitTime: this.totalWaitTime / this.totalWaitedMessages, ``` @@ -6124,12 +6124,12 @@ No properties for event [src/kernels/ipywidgets/cdnWidgetScriptSourceProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/cdnWidgetScriptSourceProvider.ts) ```typescript - return this.configurationPromise.promise; - } - this.configurationPromise = createDeferred(); - sendTelemetryEvent(Telemetry.IPyWidgetPromptToUseCDN); - const selection = await this.appShell.showInformationMessage( - DataScience.useCDNForWidgetsNoInformation(), + return this.configurationPromise.promise; + } + this.configurationPromise = createDeferred(); + sendTelemetryEvent(Telemetry.IPyWidgetPromptToUseCDN); + const selection = await this.appShell.showInformationMessage( + DataScience.useCDNForWidgetsNoInformation(), { modal: true }, ``` @@ -6154,12 +6154,12 @@ No properties for event [src/kernels/ipywidgets/cdnWidgetScriptSourceProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/cdnWidgetScriptSourceProvider.ts) ```typescript - break; - } - - sendTelemetryEvent(Telemetry.IPyWidgetPromptToUseCDNSelection, undefined, { selection: selectionForTelemetry }); - this.configurationPromise.resolve(); - } + break; + } + + sendTelemetryEvent(Telemetry.IPyWidgetPromptToUseCDNSelection, undefined, { selection: selectionForTelemetry }); + this.configurationPromise.resolve(); + } private async updateScriptSources(scriptSources: WidgetCDNs[]) { ``` @@ -6184,12 +6184,12 @@ No properties for event [src/kernels/ipywidgets/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/commonMessageCoordinator.ts) ```typescript - private sendRenderFailureTelemetry(payload: Error) { - try { - traceError('Error rendering a widget: ', payload); - sendTelemetryEvent(Telemetry.IPyWidgetRenderFailure); - } catch { - // Do nothing on a failure + private sendRenderFailureTelemetry(payload: Error) { + try { + traceError('Error rendering a widget: ', payload); + sendTelemetryEvent(Telemetry.IPyWidgetRenderFailure); + } catch { + // Do nothing on a failure } ``` @@ -6235,24 +6235,24 @@ No properties for event [src/kernels/ipywidgets/localIPyWidgetScriptManager.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/localIPyWidgetScriptManager.node.ts) ```typescript - LocalIPyWidgetScriptManager.nbExtensionsCopiedKernelConnectionList.add( - this.kernel.kernelConnectionMetadata.id - ); - sendTelemetryEvent(Telemetry.IPyWidgetNbExtensionCopyTime, stopWatch.elapsedTime); - return baseUrl; - } catch (ex) { + LocalIPyWidgetScriptManager.nbExtensionsCopiedKernelConnectionList.add( + this.kernel.kernelConnectionMetadata.id + ); + sendTelemetryEvent(Telemetry.IPyWidgetNbExtensionCopyTime, stopWatch.elapsedTime); + return baseUrl; + } catch (ex) { sendTelemetryEvent(Telemetry.IPyWidgetNbExtensionCopyTime, undefined, undefined, ex); ``` [src/kernels/ipywidgets/localIPyWidgetScriptManager.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/localIPyWidgetScriptManager.node.ts) ```typescript - sendTelemetryEvent(Telemetry.IPyWidgetNbExtensionCopyTime, stopWatch.elapsedTime); - return baseUrl; - } catch (ex) { - sendTelemetryEvent(Telemetry.IPyWidgetNbExtensionCopyTime, undefined, undefined, ex); - throw ex; - } + sendTelemetryEvent(Telemetry.IPyWidgetNbExtensionCopyTime, stopWatch.elapsedTime); + return baseUrl; + } catch (ex) { + sendTelemetryEvent(Telemetry.IPyWidgetNbExtensionCopyTime, undefined, undefined, ex); + throw ex; + } } ``` @@ -6277,12 +6277,12 @@ No properties for event [src/kernels/ipywidgets/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/commonMessageCoordinator.ts) ```typescript - this.jupyterOutput.appendLine( - DataScience.unhandledMessage().format(msg.header.msg_type, JSON.stringify(msg.content)) - ); - sendTelemetryEvent(Telemetry.IPyWidgetUnhandledMessage, undefined, { msg_type: msg.header.msg_type }); - } catch { - // Don't care if this doesn't get logged + this.jupyterOutput.appendLine( + DataScience.unhandledMessage().format(msg.header.msg_type, JSON.stringify(msg.content)) + ); + sendTelemetryEvent(Telemetry.IPyWidgetUnhandledMessage, undefined, { msg_type: msg.header.msg_type }); + } catch { + // Don't care if this doesn't get logged } ``` @@ -6307,12 +6307,12 @@ No properties for event [src/kernels/ipywidgets/ipyWidgetScriptSourceProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/ipyWidgetScriptSourceProvider.ts) ```typescript - } - } - - sendTelemetryEvent(Telemetry.HashedIPyWidgetNameUsed, undefined, { - hashedName: getTelemetrySafeHashedString(found.moduleName), - source: found.source, + } + } + + sendTelemetryEvent(Telemetry.HashedIPyWidgetNameUsed, undefined, { + hashedName: getTelemetrySafeHashedString(found.moduleName), + source: found.source, cdnSearched: this.configuredScriptSources.length > 0 ``` @@ -6337,12 +6337,12 @@ No properties for event [src/kernels/ipywidgets/commonMessageCoordinator.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets/commonMessageCoordinator.ts) ```typescript - } - private sendUnsupportedWidgetVersionFailureTelemetry(payload: NotifyIPyWidgetWidgetVersionNotSupportedAction) { - try { - sendTelemetryEvent(Telemetry.IPyWidgetWidgetVersionNotSupportedLoadFailure, 0, { - moduleHash: getTelemetrySafeHashedString(payload.moduleName), - moduleVersion: payload.moduleVersion + } + private sendUnsupportedWidgetVersionFailureTelemetry(payload: NotifyIPyWidgetWidgetVersionNotSupportedAction) { + try { + sendTelemetryEvent(Telemetry.IPyWidgetWidgetVersionNotSupportedLoadFailure, 0, { + moduleHash: getTelemetrySafeHashedString(payload.moduleName), + moduleVersion: payload.moduleVersion }); ``` @@ -6365,24 +6365,24 @@ No properties for event [src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts) ```typescript - this.throwIfDisposedOrCancelled(cancelToken); - const baseUrl = this.connection?.baseUrl || ''; - this.logRemoteOutput(DataScience.createdNewNotebook().format(baseUrl)); - sendKernelTelemetryEvent(resource, Telemetry.JupyterCreatingNotebook, stopWatch.elapsedTime); - return session; - } catch (ex) { + this.throwIfDisposedOrCancelled(cancelToken); + const baseUrl = this.connection?.baseUrl || ''; + this.logRemoteOutput(DataScience.createdNewNotebook().format(baseUrl)); + sendKernelTelemetryEvent(resource, Telemetry.JupyterCreatingNotebook, stopWatch.elapsedTime); + return session; + } catch (ex) { sendKernelTelemetryEvent( ``` [src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts) ```typescript - } catch (ex) { - sendKernelTelemetryEvent( - resource, - Telemetry.JupyterCreatingNotebook, - stopWatch.elapsedTime, - undefined, + } catch (ex) { + sendKernelTelemetryEvent( + resource, + Telemetry.JupyterCreatingNotebook, + stopWatch.elapsedTime, + undefined, // eslint-disable-next-line @typescript-eslint/no-explicit-any ``` @@ -6409,12 +6409,12 @@ No properties for event [src/kernels/jupyter/launcher/commandLineSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/commandLineSelector.ts) ```typescript - - private async setJupyterCommandLine(val: string): Promise { - if (val) { - sendTelemetryEvent(Telemetry.JupyterCommandLineNonDefault); - } - const split = parseArgsStringToArgv(val); + + private async setJupyterCommandLine(val: string): Promise { + if (val) { + sendTelemetryEvent(Telemetry.JupyterCommandLineNonDefault); + } + const split = parseArgsStringToArgv(val); await this.configuration.updateSetting( ``` @@ -6437,12 +6437,12 @@ No properties for event [src/kernels/errors/jupyterWaitForIdleError.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/errors/jupyterWaitForIdleError.ts) ```typescript -export class JupyterWaitForIdleError extends BaseKernelError { - constructor(kernelConnectionMetadata: KernelConnectionMetadata) { - super('timeout', DataScience.jupyterLaunchTimedOut(), kernelConnectionMetadata); - sendTelemetryEvent(Telemetry.SessionIdleTimeout); - } -} +export class JupyterWaitForIdleError extends BaseKernelError { + constructor(kernelConnectionMetadata: KernelConnectionMetadata) { + super('timeout', DataScience.jupyterLaunchTimedOut(), kernelConnectionMetadata); + sendTelemetryEvent(Telemetry.SessionIdleTimeout); + } +} ``` @@ -6494,12 +6494,12 @@ No properties for event [src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) ```typescript - return JupyterInterpreterDependencyResponse.ok; - } - // Indicate no kernel spec module. - sendTelemetryEvent(Telemetry.JupyterInstalledButNotKernelSpecModule); - if (Cancellation.isCanceled(token)) { - return JupyterInterpreterDependencyResponse.cancel; + return JupyterInterpreterDependencyResponse.ok; + } + // Indicate no kernel spec module. + sendTelemetryEvent(Telemetry.JupyterInstalledButNotKernelSpecModule); + if (Cancellation.isCanceled(token)) { + return JupyterInterpreterDependencyResponse.cancel; } ``` @@ -6522,12 +6522,12 @@ No properties for event [src/kernels/jupyter/jupyterKernelService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.node.ts) ```typescript - */ - // eslint-disable-next-line - // eslint-disable-next-line complexity - @captureTelemetry(Telemetry.RegisterInterpreterAsKernel, undefined, true) - @traceDecoratorError('Failed to register an interpreter as a kernel') - // eslint-disable-next-line + */ + // eslint-disable-next-line + // eslint-disable-next-line complexity + @captureTelemetry(Telemetry.RegisterInterpreterAsKernel, undefined, true) + @traceDecoratorError('Failed to register an interpreter as a kernel') + // eslint-disable-next-line private async registerKernel( ``` @@ -6542,12 +6542,12 @@ No description provided ## Properties -- - /** - * Total time spent in attempting to start and connect to jupyter before giving up. - * - * @type {number} - */ +- + /** + * Total time spent in attempting to start and connect to jupyter before giving up. + * + * @type {number} + */ timeout: number; ## Locations Used @@ -6573,12 +6573,12 @@ No properties for event [src/kernels/jupyter/launcher/jupyterExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts) ```typescript - } - - // eslint-disable-next-line - @captureTelemetry(Telemetry.StartJupyter) - private async startNotebookServer( - resource: Resource, + } + + // eslint-disable-next-line + @captureTelemetry(Telemetry.StartJupyter) + private async startNotebookServer( + resource: Resource, useDefaultConfig: boolean, ``` @@ -6602,12 +6602,12 @@ No properties for event [src/notebooks/telemetry/kernelTelemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/telemetry/kernelTelemetry.ts) ```typescript - }); - trackKernelResourceInformation(resource, counters); - if (stopWatch) { - sendKernelTelemetryEvent(resource, Telemetry.KernelCount, stopWatch.elapsedTime, counters); - } -} + }); + trackKernelResourceInformation(resource, counters); + if (stopWatch) { + sendKernelTelemetryEvent(resource, Telemetry.KernelCount, stopWatch.elapsedTime, counters); + } +} ``` @@ -6656,12 +6656,12 @@ No properties for event [src/kernels/raw/launcher/kernelLauncher.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelLauncher.node.ts) ```typescript - // Should be available now, wait with a timeout - return await this.launchProcess(kernelConnectionMetadata, resource, workingDirectory, timeout, cancelToken); - })(); - sendKernelTelemetryWhenDone(resource, Telemetry.KernelLauncherPerf, promise); - return promise; - } + // Should be available now, wait with a timeout + return await this.launchProcess(kernelConnectionMetadata, resource, workingDirectory, timeout, cancelToken); + })(); + sendKernelTelemetryWhenDone(resource, Telemetry.KernelLauncherPerf, promise); + return promise; + } ``` @@ -6676,66 +6676,66 @@ No description provided ## Properties -- - /** - * Whether this is the first time in the session. - * (fetching kernels first time in the session is slower, later its cached). - * This is a generic property supported for all telemetry (sent by decorators). - */ +- + /** + * Whether this is the first time in the session. + * (fetching kernels first time in the session is slower, later its cached). + * This is a generic property supported for all telemetry (sent by decorators). + */ firstTime?: boolean; -- - /** - * Whether this telemetry is for listing of all kernels or just python or just non-python. - * (fetching kernels first time in the session is slower, later its cached). - */ +- + /** + * Whether this telemetry is for listing of all kernels or just python or just non-python. + * (fetching kernels first time in the session is slower, later its cached). + */ kind: 'remote' | 'local' | 'localKernelSpec' | 'localPython'; ## Locations Used [src/kernels/raw/finder/localKnownPathKernelSpecFinder.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKnownPathKernelSpecFinder.node.ts) ```typescript - /** - * @param {boolean} includePythonKernels Include/exclude Python kernels in the result. - */ - @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'localKernelSpec' }) - public async listKernelSpecs( - includePythonKernels: boolean, + /** + * @param {boolean} includePythonKernels Include/exclude Python kernels in the result. + */ + @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'localKernelSpec' }) + public async listKernelSpecs( + includePythonKernels: boolean, cancelToken?: CancellationToken ``` [src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.node.ts) ```typescript - ) { - super(fs, workspaceService, extensionChecker, globalState); - } - @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'localPython' }) - public async listKernelSpecs(resource: Resource, ignoreCache?: boolean, cancelToken?: CancellationToken) { - // Get an id for the workspace folder, if we don't have one, use the fsPath of the resource + ) { + super(fs, workspaceService, extensionChecker, globalState); + } + @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'localPython' }) + public async listKernelSpecs(resource: Resource, ignoreCache?: boolean, cancelToken?: CancellationToken) { + // Get an id for the workspace folder, if we don't have one, use the fsPath of the resource const workspaceFolderId = ``` [src/kernels/raw/finder/localKernelFinder.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKernelFinder.node.ts) ```typescript - * Search all our local file system locations for installed kernel specs and return them - */ - @traceDecoratorError('List kernels failed') - @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'local' }) - public async listKernels( - resource: Resource, + * Search all our local file system locations for installed kernel specs and return them + */ + @traceDecoratorError('List kernels failed') + @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'local' }) + public async listKernels( + resource: Resource, @ignoreLogging() cancelToken?: CancellationToken ``` [src/kernels/jupyter/remoteKernelFinder.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/remoteKernelFinder.ts) ```typescript - ) {} - - // Talk to the remote server to determine sessions - @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'remote' }) - public async listKernels( - _resource: Resource, + ) {} + + // Talk to the remote server to determine sessions + @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'remote' }) + public async listKernels( + _resource: Resource, connInfo: INotebookProviderConnection, ``` @@ -6750,12 +6750,12 @@ No description provided ## Properties -- +- action: 'displayed'; -- // Message displayed. - /** - * Language found in the notebook if a known language. Otherwise 'unknown' - */ +- // Message displayed. + /** + * Language found in the notebook if a known language. Otherwise 'unknown' + */ language: string; ## Locations Used @@ -6831,12 +6831,12 @@ No properties for event [src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) ```typescript - .then(() => true) - .catch((e) => { - traceError(`Kernel spec not found: `, e); - sendTelemetryEvent(Telemetry.KernelSpecNotFound); - return false; - }); + .then(() => true) + .catch((e) => { + traceError(`Kernel spec not found: `, e); + sendTelemetryEvent(Telemetry.KernelSpecNotFound); + return false; + }); } ``` @@ -6851,10 +6851,10 @@ No description provided ## Properties -- - /** - * Number of kernel specs. - */ +- + /** + * Number of kernel specs. + */ count: number; ## Locations Used @@ -6881,12 +6881,12 @@ No properties for event [src/webviews/extension-side/variablesView/variableView.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/variablesView/variableView.ts) ```typescript - this.dataViewerChecker = new DataViewerChecker(configuration, appShell); - } - - @captureTelemetry(Telemetry.NativeVariableViewLoaded) - public async load(codeWebview: vscodeWebviewView) { - await super.loadWebview(Uri.file(process.cwd()), codeWebview).catch(traceError); + this.dataViewerChecker = new DataViewerChecker(configuration, appShell); + } + + @captureTelemetry(Telemetry.NativeVariableViewLoaded) + public async load(codeWebview: vscodeWebviewView) { + await super.loadWebview(Uri.file(process.cwd()), codeWebview).catch(traceError); ``` @@ -6909,12 +6909,12 @@ No properties for event [src/webviews/extension-side/variablesView/variableView.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/variablesView/variableView.ts) ```typescript - - // I've we've been made visible, make sure that we are updated - if (visible) { - sendTelemetryEvent(Telemetry.NativeVariableViewMadeVisible); - // If there is an active execution count, update the view with that info - // Keep the variables up to date if document has run cells while the view was not visible + + // I've we've been made visible, make sure that we are updated + if (visible) { + sendTelemetryEvent(Telemetry.NativeVariableViewMadeVisible); + // If there is an active execution count, update the view with that info + // Keep the variables up to date if document has run cells while the view was not visible if (this.notebookWatcher.activeNotebookExecutionCount !== undefined) { ``` @@ -6935,12 +6935,12 @@ No description provided [src/notebooks/notebookUsageTracker.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookUsageTracker.ts) ```typescript - public dispose() { - // Send a bunch of telemetry - if (this.openedNotebookCount) { - sendTelemetryEvent(Telemetry.NotebookOpenCount, undefined, { count: this.openedNotebookCount }); - } - if (this.executedNotebooksIndexedByUri.size) { + public dispose() { + // Send a bunch of telemetry + if (this.openedNotebookCount) { + sendTelemetryEvent(Telemetry.NotebookOpenCount, undefined, { count: this.openedNotebookCount }); + } + if (this.executedNotebooksIndexedByUri.size) { sendTelemetryEvent(Telemetry.NotebookRunCount, undefined, { ``` @@ -6980,12 +6980,12 @@ No description provided [src/notebooks/notebookUsageTracker.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookUsageTracker.ts) ```typescript - sendTelemetryEvent(Telemetry.NotebookOpenCount, undefined, { count: this.openedNotebookCount }); - } - if (this.executedNotebooksIndexedByUri.size) { - sendTelemetryEvent(Telemetry.NotebookRunCount, undefined, { - count: this.executedNotebooksIndexedByUri.size - }); + sendTelemetryEvent(Telemetry.NotebookOpenCount, undefined, { count: this.openedNotebookCount }); + } + if (this.executedNotebooksIndexedByUri.size) { + sendTelemetryEvent(Telemetry.NotebookRunCount, undefined, { + count: this.executedNotebooksIndexedByUri.size + }); } ``` @@ -7053,12 +7053,12 @@ Event can be removed. Not referenced anywhere [src/kernels/jupyter/preferredRemoteKernelIdProvider.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/preferredRemoteKernelIdProvider.ts) ```typescript - } - - // Prune list if too big - sendTelemetryEvent(Telemetry.NumberOfSavedRemoteKernelIds, undefined, { count: list.length }); - while (list.length > MaximumKernelIdListSize) { - requiresUpdate = true; + } + + // Prune list if too big + sendTelemetryEvent(Telemetry.NumberOfSavedRemoteKernelIds, undefined, { count: list.length }); + while (list.length > MaximumKernelIdListSize) { + requiresUpdate = true; list.shift(); ``` @@ -7083,24 +7083,24 @@ No properties for event [src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) ```typescript - // Setup telemetry - if (!this.perceivedJupyterStartupTelemetryCaptured) { - this.perceivedJupyterStartupTelemetryCaptured = true; - sendTelemetryEvent(Telemetry.PerceivedJupyterStartupNotebook, stopWatch.elapsedTime); - executionPromise - .finally(() => + // Setup telemetry + if (!this.perceivedJupyterStartupTelemetryCaptured) { + this.perceivedJupyterStartupTelemetryCaptured = true; + sendTelemetryEvent(Telemetry.PerceivedJupyterStartupNotebook, stopWatch.elapsedTime); + executionPromise + .finally(() => sendTelemetryEvent(Telemetry.StartExecuteNotebookCellPerceivedCold, stopWatch.elapsedTime) ``` [src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) ```typescript - - sendKernelTelemetryEvent( - this.resourceUri, - Telemetry.PerceivedJupyterStartupNotebook, - stopWatch.elapsedTime - ); + + sendKernelTelemetryEvent( + this.resourceUri, + Telemetry.PerceivedJupyterStartupNotebook, + stopWatch.elapsedTime + ); this._session = session; ``` @@ -7125,12 +7125,12 @@ No properties for event [src/notebooks/controllers/notebookControllerManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/notebookControllerManager.ts) ```typescript - ? PYTHON_LANGUAGE - : getTelemetrySafeLanguage(getLanguageInNotebookMetadata(notebookMetadata) || ''); - - sendTelemetryEvent(Telemetry.PreferredKernel, undefined, { - result: preferredConnection ? 'found' : 'notfound', - resourceType, + ? PYTHON_LANGUAGE + : getTelemetrySafeLanguage(getLanguageInNotebookMetadata(notebookMetadata) || ''); + + sendTelemetryEvent(Telemetry.PreferredKernel, undefined, { + result: preferredConnection ? 'found' : 'notfound', + resourceType, language: telemetrySafeLanguage, ``` @@ -7145,19 +7145,19 @@ No description provided ## Properties -- +- matchedReason: PreferredKernelExactMatchReason; ## Locations Used [src/notebooks/controllers/notebookControllerManager.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/notebookControllerManager.ts) ```typescript - onlyConnection && (matchReason |= PreferredKernelExactMatchReason.OnlyKernel); - topMatchIsPreferredInterpreter && (matchReason |= PreferredKernelExactMatchReason.WasPreferredInterpreter); - isExactMatch && (matchReason |= PreferredKernelExactMatchReason.IsExactMatch); - sendTelemetryEvent(Telemetry.PreferredKernelExactMatch, undefined, { - matchedReason: matchReason - }); + onlyConnection && (matchReason |= PreferredKernelExactMatchReason.OnlyKernel); + topMatchIsPreferredInterpreter && (matchReason |= PreferredKernelExactMatchReason.WasPreferredInterpreter); + isExactMatch && (matchReason |= PreferredKernelExactMatchReason.IsExactMatch); + sendTelemetryEvent(Telemetry.PreferredKernelExactMatch, undefined, { + matchedReason: matchReason + }); } ``` @@ -7172,82 +7172,82 @@ No description provided ## Properties -- - action: - | 'displayed' // Message displayed. - | 'dismissed' // user dismissed the message. +- + action: + | 'displayed' // Message displayed. + | 'dismissed' // user dismissed the message. | 'download'; ## Locations Used [src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) ```typescript - } - } - private async handleExecutionWithoutPythonExtension() { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); - const selection = await this.appShell.showInformationMessage( - DataScience.pythonExtensionRequiredToRunNotebook(), + } + } + private async handleExecutionWithoutPythonExtension() { + sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); + const selection = await this.appShell.showInformationMessage( + DataScience.pythonExtensionRequiredToRunNotebook(), { modal: true }, ``` [src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) ```typescript - Common.install() - ); - if (selection === Common.install()) { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); - this.commandManager.executeCommand('extension.open', PythonExtension).then(noop, noop); - } else { + Common.install() + ); + if (selection === Common.install()) { + sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); + this.commandManager.executeCommand('extension.open', PythonExtension).then(noop, noop); + } else { sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); ``` [src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) ```typescript - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); - this.commandManager.executeCommand('extension.open', PythonExtension).then(noop, noop); - } else { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); - } - } + sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); + this.commandManager.executeCommand('extension.open', PythonExtension).then(noop, noop); + } else { + sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); + } + } private async handleExecutionWithoutPython() { ``` [src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) ```typescript - // Ask user if they want to install and then wait for them to actually install it. - const yes = localize.Common.bannerLabelYes(); - const no = localize.Common.bannerLabelNo(); - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); - const answer = await this.appShell.showInformationMessage( - localize.DataScience.pythonExtensionRequired(), + // Ask user if they want to install and then wait for them to actually install it. + const yes = localize.Common.bannerLabelYes(); + const no = localize.Common.bannerLabelNo(); + sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); + const answer = await this.appShell.showInformationMessage( + localize.DataScience.pythonExtensionRequired(), { modal: true }, ``` [src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) ```typescript - no - ); - if (answer === yes) { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); - await this.installPythonExtension(); - } else { + no + ); + if (answer === yes) { + sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); + await this.installPythonExtension(); + } else { sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); ``` [src/platform/api/pythonApi.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts) ```typescript - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); - await this.installPythonExtension(); - } else { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); - } - } + sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); + await this.installPythonExtension(); + } else { + sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'dismissed' }); + } + } private async installPythonExtension() { ``` @@ -7274,24 +7274,24 @@ No properties for event [src/kernels/helpers.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.node.ts) ```typescript - } - const sysExecutable = concatMultilineString(output.text).trim().toLowerCase(); - const match = areInterpreterPathsSame(kernelConnection.interpreter.uri, Uri.file(sysExecutable)); - sendTelemetryEvent(Telemetry.PythonKerneExecutableMatches, undefined, { - match: match ? 'true' : 'false', - kernelConnectionType: kernelConnection.kind + } + const sysExecutable = concatMultilineString(output.text).trim().toLowerCase(); + const match = areInterpreterPathsSame(kernelConnection.interpreter.uri, Uri.file(sysExecutable)); + sendTelemetryEvent(Telemetry.PythonKerneExecutableMatches, undefined, { + match: match ? 'true' : 'false', + kernelConnectionType: kernelConnection.kind }); ``` [src/kernels/helpers.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.node.ts) ```typescript - Uri.file(execOutput.stdout.trim().toLowerCase()), - Uri.file(sysExecutable) - ); - sendTelemetryEvent(Telemetry.PythonKerneExecutableMatches, undefined, { - match: match ? 'true' : 'false', - kernelConnectionType: kernelConnection.kind + Uri.file(execOutput.stdout.trim().toLowerCase()), + Uri.file(sysExecutable) + ); + sendTelemetryEvent(Telemetry.PythonKerneExecutableMatches, undefined, { + match: match ? 'true' : 'false', + kernelConnectionType: kernelConnection.kind }); ``` @@ -7306,183 +7306,183 @@ No description provided ## Properties -- +- moduleName: string; -- - /** - * Whether the module was already (once before) installed into the python environment or - * whether this already exists (detected via `pip list`) - */ +- + /** + * Whether the module was already (once before) installed into the python environment or + * whether this already exists (detected via `pip list`) + */ isModulePresent?: 'true' | undefined; -- - action: - | 'cancelled' // User cancelled the installation or closed the notebook or the like. - | 'displayed' // Install prompt may have been displayed. - | 'prompted' // Install prompt was displayed. - | 'installed' // Installation disabled (this is what python extension returns). - | 'ignored' // Installation disabled (this is what python extension returns). - | 'disabled' // Installation disabled (this is what python extension returns). - | 'failed' // Installation disabled (this is what python extension returns). - | 'install' // User chose install from prompt. - | 'donotinstall' // User chose not to install from prompt. - | 'differentKernel' // User chose to select a different kernel. - | 'error' // Some other error. - | 'installedInJupyter' // The package was successfully installed in Jupyter whilst failed to install in Python ext. - | 'failedToInstallInJupyter' // Failed to install the package in Jupyter as well as Python ext. +- + action: + | 'cancelled' // User cancelled the installation or closed the notebook or the like. + | 'displayed' // Install prompt may have been displayed. + | 'prompted' // Install prompt was displayed. + | 'installed' // Installation disabled (this is what python extension returns). + | 'ignored' // Installation disabled (this is what python extension returns). + | 'disabled' // Installation disabled (this is what python extension returns). + | 'failed' // Installation disabled (this is what python extension returns). + | 'install' // User chose install from prompt. + | 'donotinstall' // User chose not to install from prompt. + | 'differentKernel' // User chose to select a different kernel. + | 'error' // Some other error. + | 'installedInJupyter' // The package was successfully installed in Jupyter whilst failed to install in Python ext. + | 'failedToInstallInJupyter' // Failed to install the package in Jupyter as well as Python ext. | 'dismissed'; -- // User chose to dismiss the prompt. +- // User chose to dismiss the prompt. resourceType?: 'notebook' | 'interactive'; -- - /** - * Hash of the resource (notebook.uri or pythonfile.uri associated with this). - * If we run the same notebook tomorrow, the hash will be the same. - */ +- + /** + * Hash of the resource (notebook.uri or pythonfile.uri associated with this). + * If we run the same notebook tomorrow, the hash will be the same. + */ resourceHash?: string; -- +- pythonEnvType?: EnvironmentType; ## Locations Used [src/kernels/installer/productInstaller.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/installer/productInstaller.node.ts) ```typescript - action = 'failed'; - throw ex; - } finally { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action, - moduleName: ProductNames.get(product)! + action = 'failed'; + throw ex; + } finally { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action, + moduleName: ProductNames.get(product)! }); ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - const productNameForTelemetry = products.map((product) => ProductNames.get(product)!).join(', '); - const resourceType = resource ? getResourceType(resource) : undefined; - const resourceHash = resource ? getTelemetrySafeHashedString(resource.toString()) : undefined; - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'displayed', - moduleName: productNameForTelemetry, + const productNameForTelemetry = products.map((product) => ProductNames.get(product)!).join(', '); + const resourceType = resource ? getResourceType(resource) : undefined; + const resourceHash = resource ? getTelemetrySafeHashedString(resource.toString()) : undefined; + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'displayed', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - : [Common.install()]; - try { - if (!this.isCodeSpace) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'prompted', - moduleName: productNameForTelemetry, + : [Common.install()]; + try { + if (!this.isCodeSpace) { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'prompted', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - promptCancellationPromise - ]); - if (cancelTokenSource.token.isCancellationRequested) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'dismissed', - moduleName: productNameForTelemetry, + promptCancellationPromise + ]); + if (cancelTokenSource.token.isCancellationRequested) { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'dismissed', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - return KernelInterpreterDependencyResponse.cancel; - } - if (selection === selectKernel) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'differentKernel', - moduleName: productNameForTelemetry, + return KernelInterpreterDependencyResponse.cancel; + } + if (selection === selectKernel) { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'differentKernel', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - }); - return KernelInterpreterDependencyResponse.selectDifferentKernel; - } else if (selection === Common.install()) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'install', - moduleName: productNameForTelemetry, + }); + return KernelInterpreterDependencyResponse.selectDifferentKernel; + } else if (selection === Common.install()) { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'install', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - cancellationPromise - ]); - if (response === InstallerResponse.Installed) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'installed', - moduleName: productNameForTelemetry, + cancellationPromise + ]); + if (response === InstallerResponse.Installed) { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'installed', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - }); - return KernelInterpreterDependencyResponse.ok; - } else if (response === InstallerResponse.Ignore) { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'failed', - moduleName: productNameForTelemetry, + }); + return KernelInterpreterDependencyResponse.ok; + } else if (response === InstallerResponse.Ignore) { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'failed', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - } - } - - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'dismissed', - moduleName: productNameForTelemetry, + } + } + + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'dismissed', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/kernelDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.node.ts) ```typescript - return KernelInterpreterDependencyResponse.cancel; - } catch (ex) { - traceError(`Failed to install ${productNameForTelemetry}`, ex); - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'error', - moduleName: productNameForTelemetry, + return KernelInterpreterDependencyResponse.cancel; + } catch (ex) { + traceError(`Failed to install ${productNameForTelemetry}`, ex); + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'error', + moduleName: productNameForTelemetry, resourceType, ``` [src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.node.ts) ```typescript - pipInstalledInNonCondaEnv === false ? [Product.pip].concat(missingProducts) : missingProducts, - interpreter.displayName - ); - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'displayed', - moduleName: ProductNames.get(Product.jupyter)!, + pipInstalledInNonCondaEnv === false ? [Product.pip].concat(missingProducts) : missingProducts, + interpreter.displayName + ); + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'displayed', + moduleName: ProductNames.get(Product.jupyter)!, pythonEnvType: interpreter.envType ``` [src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) ```typescript - interpreter: PythonEnvironment, - tokenSource: CancellationTokenSource - ): Promise { - sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { - action: 'displayed', - moduleName: ProductNames.get(Product.pandas)!, + interpreter: PythonEnvironment, + tokenSource: CancellationTokenSource + ): Promise { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'displayed', + moduleName: ProductNames.get(Product.pandas)!, pythonEnvType: interpreter?.envType ``` @@ -7497,46 +7497,46 @@ No description provided ## Properties -- - action: - | 'displayed' // Message displayed. - | 'dismissed' // user dismissed the message. +- + action: + | 'displayed' // Message displayed. + | 'dismissed' // user dismissed the message. | 'download'; ## Locations Used [src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) ```typescript - } - } - private async handleExecutionWithoutPython() { - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'displayed' }); - const selection = await this.appShell.showErrorMessage( - DataScience.pythonNotInstalledNonMarkdown(), + } + } + private async handleExecutionWithoutPython() { + sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'displayed' }); + const selection = await this.appShell.showErrorMessage( + DataScience.pythonNotInstalledNonMarkdown(), { modal: true }, ``` [src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) ```typescript - Common.install() - ); - if (selection === Common.install()) { - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'download' }); - this.appShell.openUrl('https://www.python.org/downloads'); - } else { + Common.install() + ); + if (selection === Common.install()) { + sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'download' }); + this.appShell.openUrl('https://www.python.org/downloads'); + } else { sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'dismissed' }); ``` [src/notebooks/controllers/noPythonKernelsNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts) ```typescript - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'download' }); - this.appShell.openUrl('https://www.python.org/downloads'); - } else { - sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'dismissed' }); - } - } + sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'download' }); + this.appShell.openUrl('https://www.python.org/downloads'); + } else { + sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'dismissed' }); + } + } } ``` @@ -7561,12 +7561,12 @@ No properties for event [src/kernels/kernelFinder.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelFinder.base.ts) ```typescript - ) {} - - @traceDecoratorVerbose('Rank Kernels', TraceOptions.BeforeCall | TraceOptions.Arguments) - @captureTelemetry(Telemetry.RankKernelsPerf) - public async rankKernels( - resource: Resource, + ) {} + + @traceDecoratorVerbose('Rank Kernels', TraceOptions.BeforeCall | TraceOptions.Arguments) + @captureTelemetry(Telemetry.RankKernelsPerf) + public async rankKernels( + resource: Resource, notebookMetadata?: nbformat.INotebookMetadata, ``` @@ -7590,12 +7590,12 @@ No properties for event [src/kernels/raw/session/hostRawNotebookProvider.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/hostRawNotebookProvider.node.ts) ```typescript - return this.rawNotebookSupportedService.isSupported; - } - - @captureTelemetry(Telemetry.RawKernelCreatingNotebook, undefined, true) - public async createNotebook( - resource: Resource, + return this.rawNotebookSupportedService.isSupported; + } + + @captureTelemetry(Telemetry.RawKernelCreatingNotebook, undefined, true) + public async createNotebook( + resource: Resource, kernelConnection: KernelConnectionMetadata, ``` @@ -7623,12 +7623,12 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - } else { - traceWarning(`Didn't get response for requestKernelInfo after ${stopWatch.elapsedTime}ms.`); - } - sendTelemetryEvent(Telemetry.RawKernelInfoResonse, stopWatch.elapsedTime, { - attempts, - timedout: !gotIoPubMessage.completed + } else { + traceWarning(`Didn't get response for requestKernelInfo after ${stopWatch.elapsedTime}ms.`); + } + sendTelemetryEvent(Telemetry.RawKernelInfoResonse, stopWatch.elapsedTime, { + attempts, + timedout: !gotIoPubMessage.completed }); ``` @@ -7651,12 +7651,12 @@ No properties for event [src/kernels/raw/launcher/kernelProcess.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelProcess.node.ts) ```typescript - } - } - - @captureTelemetry(Telemetry.RawKernelProcessLaunch, undefined, true) - public async launch(workingDirectory: string, timeout: number, cancelToken: CancellationToken): Promise { - if (this.launchedOnce) { + } + } + + @captureTelemetry(Telemetry.RawKernelProcessLaunch, undefined, true) + public async launch(workingDirectory: string, timeout: number, cancelToken: CancellationToken): Promise { + if (this.launchedOnce) { throw new Error('Kernel has already been launched.'); ``` @@ -7680,12 +7680,12 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - throw error; - } - } finally { - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionConnect, stopWatch.elapsedTime); - } - + throw error; + } + } finally { + sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionConnect, stopWatch.elapsedTime); + } + this.connected = true; ``` @@ -7710,12 +7710,12 @@ No properties for event [src/kernels/raw/session/rawSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawSession.node.ts) ```typescript - public async dispose() { - // We want to know who called dispose on us - const stacktrace = new Error().stack; - sendTelemetryEvent(Telemetry.RawKernelSessionDisposed, undefined, { stacktrace }); - - // Now actually dispose ourselves + public async dispose() { + // We want to know who called dispose on us + const stacktrace = new Error().stack; + sendTelemetryEvent(Telemetry.RawKernelSessionDisposed, undefined, { stacktrace }); + + // Now actually dispose ourselves this.isDisposing = true; ``` @@ -7741,36 +7741,36 @@ No properties for event [src/kernels/raw/launcher/kernelLauncher.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelLauncher.node.ts) ```typescript - - const disposable = kernelProcess.exited( - ({ exitCode, reason }) => { - sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { - exitCode, - exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(reason) + + const disposable = kernelProcess.exited( + ({ exitCode, reason }) => { + sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { + exitCode, + exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(reason) }); ``` [src/kernels/raw/session/rawSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawSession.node.ts) ```typescript - traceError(`Disposing session as kernel process died ExitCode: ${e.exitCode}, Reason: ${e.reason}`); - // Send telemetry so we know why the kernel process exited, - // as this affects our kernel startup success - sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { - exitCode: e.exitCode, - exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(e.reason) + traceError(`Disposing session as kernel process died ExitCode: ${e.exitCode}, Reason: ${e.reason}`); + // Send telemetry so we know why the kernel process exited, + // as this affects our kernel startup success + sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { + exitCode: e.exitCode, + exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(e.reason) }); ``` [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - if (session !== this.session) { - return; - } - sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { - exitCode, - exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(reason) + if (session !== this.session) { + return; + } + sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { + exitCode, + exitReason: getTelemetrySafeErrorMessageFromPythonTraceback(reason) }); ``` @@ -7793,12 +7793,12 @@ No properties for event [src/notebooks/controllers/kernelConnector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/kernelConnector.ts) ```typescript - const rawNotebookProvider = serviceContainer.tryGet(IRawNotebookProvider); - const rawLocalKernel = rawNotebookProvider?.isSupported && isLocal; - if (rawLocalKernel && errorContext === 'start') { - sendKernelTelemetryEvent(resource, Telemetry.RawKernelSessionStartNoIpykernel, { - reason: handleResult - }); + const rawNotebookProvider = serviceContainer.tryGet(IRawNotebookProvider); + const rawLocalKernel = rawNotebookProvider?.isSupported && isLocal; + if (rawLocalKernel && errorContext === 'start') { + sendKernelTelemetryEvent(resource, Telemetry.RawKernelSessionStartNoIpykernel, { + reason: handleResult + }); } ``` @@ -7824,12 +7824,12 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - // We want to know why we got shut down - const stacktrace = new Error().stack; - return super.shutdownSession(session, statusHandler, isRequestToShutdownRestartSession).then(() => { - sendTelemetryEvent(Telemetry.RawKernelSessionShutdown, undefined, { - isRequestToShutdownRestartSession, - stacktrace + // We want to know why we got shut down + const stacktrace = new Error().stack; + return super.shutdownSession(session, statusHandler, isRequestToShutdownRestartSession).then(() => { + sendTelemetryEvent(Telemetry.RawKernelSessionShutdown, undefined, { + isRequestToShutdownRestartSession, + stacktrace }); ``` @@ -7853,48 +7853,48 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - Cancellation.throwIfCanceled(options.token); - // Only connect our session if we didn't cancel or timeout - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartSuccess); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStart, stopWatch.elapsedTime); - traceInfo( - `${DataScience.kernelStarted().format( + Cancellation.throwIfCanceled(options.token); + // Only connect our session if we didn't cancel or timeout + sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartSuccess); + sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStart, stopWatch.elapsedTime); + traceInfo( + `${DataScience.kernelStarted().format( getDisplayNameOrNameOfKernelConnection(this.kernelConnectionMetadata) ``` [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - if (isCancellationError(error) || options.token.isCancellationRequested) { - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStart, - stopWatch.elapsedTime, - undefined, + if (isCancellationError(error) || options.token.isCancellationRequested) { + sendKernelTelemetryEvent( + this.resource, + Telemetry.RawKernelSessionStart, + stopWatch.elapsedTime, + undefined, error ``` [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - } else if (error instanceof TimedOutError) { - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStart, - stopWatch.elapsedTime, - undefined, + } else if (error instanceof TimedOutError) { + sendKernelTelemetryEvent( + this.resource, + Telemetry.RawKernelSessionStart, + stopWatch.elapsedTime, + undefined, error ``` [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - // Send our telemetry event with the error included - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStart, - stopWatch.elapsedTime, - undefined, + // Send our telemetry event with the error included + sendKernelTelemetryEvent( + this.resource, + Telemetry.RawKernelSessionStart, + stopWatch.elapsedTime, + undefined, // eslint-disable-next-line @typescript-eslint/no-explicit-any ``` @@ -7917,12 +7917,12 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - ); - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStartException, - undefined, - undefined, + ); + sendKernelTelemetryEvent( + this.resource, + Telemetry.RawKernelSessionStartException, + undefined, + undefined, // eslint-disable-next-line @typescript-eslint/no-explicit-any ``` @@ -7945,12 +7945,12 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - newSession = await this.startRawSession(options); - Cancellation.throwIfCanceled(options.token); - // Only connect our session if we didn't cancel or timeout - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartSuccess); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStart, stopWatch.elapsedTime); - traceInfo( + newSession = await this.startRawSession(options); + Cancellation.throwIfCanceled(options.token); + // Only connect our session if we didn't cancel or timeout + sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartSuccess); + sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStart, stopWatch.elapsedTime); + traceInfo( `${DataScience.kernelStarted().format( ``` @@ -7973,12 +7973,12 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - undefined, - error - ); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartTimeout); - traceError('Raw session failed to start in given timeout'); - throw error; + undefined, + error + ); + sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartTimeout); + traceError('Raw session failed to start in given timeout'); + throw error; } else { ``` @@ -8001,12 +8001,12 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - undefined, - error - ); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartUserCancel); - traceVerbose('Starting of raw session cancelled by user'); - throw error; + undefined, + error + ); + sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartUserCancel); + traceVerbose('Starting of raw session cancelled by user'); + throw error; } else if (error instanceof TimedOutError) { ``` @@ -8029,12 +8029,12 @@ No properties for event [src/kernels/raw/session/rawJupyterSession.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.node.ts) ```typescript - return this.startRawSession({ token: cancelToken, ui: new DisplayOptions(disableUI) }); - } - - @captureTelemetry(Telemetry.RawKernelStartRawSession, undefined, true) - private async startRawSession(options: { token: CancellationToken; ui: IDisplayOptions }): Promise { - if ( + return this.startRawSession({ token: cancelToken, ui: new DisplayOptions(disableUI) }); + } + + @captureTelemetry(Telemetry.RawKernelStartRawSession, undefined, true) + private async startRawSession(options: { token: CancellationToken; ui: IDisplayOptions }): Promise { + if ( this.kernelConnectionMetadata.kind !== 'startUsingLocalKernelSpec' && ``` @@ -8057,12 +8057,12 @@ No properties for event [src/kernels/jupyter/jupyterKernelService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.node.ts) ```typescript - ); - } - - sendTelemetryEvent(Telemetry.RegisterAndUseInterpreterAsKernel); - return kernelSpecFilePath.fsPath; - } + ); + } + + sendTelemetryEvent(Telemetry.RegisterAndUseInterpreterAsKernel); + return kernelSpecFilePath.fsPath; + } private async updateKernelEnvironment( ``` @@ -8077,10 +8077,10 @@ No description provided ## Properties -- - /** - * Number of kernel specs. - */ +- + /** + * Number of kernel specs. + */ count: number; ## Locations Used @@ -8106,12 +8106,12 @@ No properties for event [src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) ```typescript - } - - @captureTelemetry(Telemetry.RestartKernel) - @captureTelemetry(Telemetry.RestartJupyterTime) - private async restartExecution(session: IJupyterSession): Promise { - // Just use the internal session. Pending cells should have been canceled by the caller + } + + @captureTelemetry(Telemetry.RestartKernel) + @captureTelemetry(Telemetry.RestartJupyterTime) + private async restartExecution(session: IJupyterSession): Promise { + // Just use the internal session. Pending cells should have been canceled by the caller await session.restart(); ``` @@ -8134,12 +8134,12 @@ No properties for event [src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts) ```typescript - }); - } - - @captureTelemetry(Telemetry.RestartKernel) - @captureTelemetry(Telemetry.RestartJupyterTime) - private async restartExecution(session: IJupyterSession): Promise { + }); + } + + @captureTelemetry(Telemetry.RestartKernel) + @captureTelemetry(Telemetry.RestartJupyterTime) + private async restartExecution(session: IJupyterSession): Promise { // Just use the internal session. Pending cells should have been canceled by the caller ``` @@ -8154,39 +8154,39 @@ No description provided ## Properties -- +- testName: string; -- +- testResult: string; -- +- perfWarmup?: 'true'; -- +- commitHash?: string; -- +- timedCheckpoints?: string; ## Locations Used [src/test/testHooks.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/testHooks.node.ts) ```typescript - dimensions = { ...dimensions, commitHash: process.env.GIT_SHA }; - } - - traceInfoIfCI(`Sending telemetry event ${Telemetry.RunTest} with dimensions ${dimensions}`); - telemetryReporter.sendDangerousTelemetryEvent(Telemetry.RunTest, dimensions, measures); - }, + dimensions = { ...dimensions, commitHash: process.env.GIT_SHA }; + } + + traceInfoIfCI(`Sending telemetry event ${Telemetry.RunTest} with dimensions ${dimensions}`); + telemetryReporter.sendDangerousTelemetryEvent(Telemetry.RunTest, dimensions, measures); + }, afterAll: async () => { ``` [src/test/testHooks.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/testHooks.node.ts) ```typescript - } - - traceInfoIfCI(`Sending telemetry event ${Telemetry.RunTest} with dimensions ${dimensions}`); - telemetryReporter.sendDangerousTelemetryEvent(Telemetry.RunTest, dimensions, measures); - }, - afterAll: async () => { + } + + traceInfoIfCI(`Sending telemetry event ${Telemetry.RunTest} with dimensions ${dimensions}`); + telemetryReporter.sendDangerousTelemetryEvent(Telemetry.RunTest, dimensions, measures); + }, + afterAll: async () => { if (!IS_CI_SERVER) { ``` @@ -8201,51 +8201,51 @@ No description provided ## Properties -- - /** - * The result of the selection. - * notSelected - No interpreter was selected. - * selected - An interpreter was selected (and configured to have jupyter and notebook). - * installationCancelled - Installation of jupyter and/or notebook was cancelled for an interpreter. - * - * @type {('notSelected' | 'selected' | 'installationCancelled')} - */ +- + /** + * The result of the selection. + * notSelected - No interpreter was selected. + * selected - An interpreter was selected (and configured to have jupyter and notebook). + * installationCancelled - Installation of jupyter and/or notebook was cancelled for an interpreter. + * + * @type {('notSelected' | 'selected' | 'installationCancelled')} + */ result?: 'notSelected' | 'selected' | 'installationCancelled'; ## Locations Used [src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts) ```typescript - public async selectInterpreter(): Promise { - const interpreter = await this.jupyterInterpreterSelector.selectInterpreter(); - if (!interpreter) { - sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'notSelected' }); - return; - } + public async selectInterpreter(): Promise { + const interpreter = await this.jupyterInterpreterSelector.selectInterpreter(); + if (!interpreter) { + sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'notSelected' }); + return; + } ``` [src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts) ```typescript - return interpreter; - } - case JupyterInterpreterDependencyResponse.cancel: - sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'installationCancelled' }); - return; - default: + return interpreter; + } + case JupyterInterpreterDependencyResponse.cancel: + sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'installationCancelled' }); + return; + default: return this.selectInterpreter(); ``` [src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.node.ts) ```typescript - this._selectedInterpreter = interpreter; - this._onDidChangeInterpreter.fire(interpreter); - this.interpreterSelectionState.updateSelectedPythonPath(interpreter.uri); - sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'selected' }); - } - + this._selectedInterpreter = interpreter; + this._onDidChangeInterpreter.fire(interpreter); + this.interpreterSelectionState.updateSelectedPythonPath(interpreter.uri); + sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'selected' }); + } + // For a given python path check if it can run jupyter for us ``` @@ -8268,12 +8268,12 @@ No properties for event [src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.node.ts) ```typescript - if (!interpreter) { - // Unlikely scenario, user hasn't selected python, python extension will fall over. - // Get user to select something. - sendTelemetryEvent(Telemetry.SelectJupyterInterpreterMessageDisplayed); - return DataScience.selectJupyterInterpreter(); - } + if (!interpreter) { + // Unlikely scenario, user hasn't selected python, python extension will fall over. + // Get user to select something. + sendTelemetryEvent(Telemetry.SelectJupyterInterpreterMessageDisplayed); + return DataScience.selectJupyterInterpreter(); + } } ``` @@ -8296,12 +8296,12 @@ No properties for event [src/webviews/extension-side/globalActivation.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/globalActivation.ts) ```typescript - resultSettings[k] = currentValue; - } - } - sendTelemetryEvent(Telemetry.DataScienceSettings, 0, resultSettings); - } - } + resultSettings[k] = currentValue; + } + } + sendTelemetryEvent(Telemetry.DataScienceSettings, 0, resultSettings); + } + } } ``` @@ -8324,36 +8324,36 @@ No properties for event [src/interactive-window/shiftEnterBanner.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/shiftEnterBanner.ts) ```typescript - return; - } - - sendTelemetryEvent(Telemetry.ShiftEnterBannerShown); - const response = await this.appShell.showInformationMessage(this.bannerMessage, ...this.bannerLabels); - switch (response) { + return; + } + + sendTelemetryEvent(Telemetry.ShiftEnterBannerShown); + const response = await this.appShell.showInformationMessage(this.bannerMessage, ...this.bannerLabels); + switch (response) { case this.bannerLabels[InteractiveShiftEnterLabelIndex.Yes]: { ``` [src/test/datascience/shiftEnterBanner.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts) ```typescript - config.verifyAll(); - - expect(Reporter.eventNames).to.deep.equal([ - Telemetry.ShiftEnterBannerShown, - Telemetry.EnableInteractiveShiftEnter - ]); + config.verifyAll(); + + expect(Reporter.eventNames).to.deep.equal([ + Telemetry.ShiftEnterBannerShown, + Telemetry.EnableInteractiveShiftEnter + ]); }); ``` [src/test/datascience/shiftEnterBanner.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts) ```typescript - config.verifyAll(); - - expect(Reporter.eventNames).to.deep.equal([ - Telemetry.ShiftEnterBannerShown, - Telemetry.DisableInteractiveShiftEnter - ]); + config.verifyAll(); + + expect(Reporter.eventNames).to.deep.equal([ + Telemetry.ShiftEnterBannerShown, + Telemetry.DisableInteractiveShiftEnter + ]); }); ``` @@ -8376,12 +8376,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) ```typescript - throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); - } - - sendTelemetryEvent(Telemetry.PandasNotInstalled); - await this.installMissingDependencies(interpreter, tokenSource); - } finally { + throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); + } + + sendTelemetryEvent(Telemetry.PandasNotInstalled); + await this.installMissingDependencies(interpreter, tokenSource); + } finally { tokenSource.dispose(); ``` @@ -8404,12 +8404,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerDependencyService.node.ts) ```typescript - if (isVersionOfPandasSupported(pandasVersion)) { - return; - } - sendTelemetryEvent(Telemetry.PandasTooOld); - // Warn user that we cannot start because pandas is too old. - const versionStr = `${pandasVersion.major}.${pandasVersion.minor}.${pandasVersion.build}`; + if (isVersionOfPandasSupported(pandasVersion)) { + return; + } + sendTelemetryEvent(Telemetry.PandasTooOld); + // Warn user that we cannot start because pandas is too old. + const versionStr = `${pandasVersion.major}.${pandasVersion.minor}.${pandasVersion.build}`; throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); ``` @@ -8434,12 +8434,12 @@ No properties for event [src/kernels/kernel.base.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.base.ts) ```typescript - sendTelemetryEvent(Telemetry.PerceivedJupyterStartupNotebook, stopWatch.elapsedTime); - executionPromise - .finally(() => - sendTelemetryEvent(Telemetry.StartExecuteNotebookCellPerceivedCold, stopWatch.elapsedTime) - ) - .catch(noop); + sendTelemetryEvent(Telemetry.PerceivedJupyterStartupNotebook, stopWatch.elapsedTime); + executionPromise + .finally(() => + sendTelemetryEvent(Telemetry.StartExecuteNotebookCellPerceivedCold, stopWatch.elapsedTime) + ) + .catch(noop); } ``` @@ -8462,12 +8462,12 @@ No properties for event [src/kernels/jupyter/launcher/notebookStarter.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/notebookStarter.node.ts) ```typescript - } - - // Fire off telemetry for the process being talkable - sendTelemetryEvent(Telemetry.StartJupyterProcess, stopWatch.elapsedTime); - - try { + } + + // Fire off telemetry for the process being talkable + sendTelemetryEvent(Telemetry.StartJupyterProcess, stopWatch.elapsedTime); + + try { const port = parseInt(url.parse(connection.baseUrl).port || '0', 10); ``` @@ -8515,12 +8515,12 @@ No properties for event [src/kernels/common/baseJupyterSession.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/common/baseJupyterSession.ts) ```typescript -export class JupyterSessionStartError extends WrappedError { - constructor(originalException: Error) { - super(originalException.message, originalException); - sendTelemetryEvent(Telemetry.StartSessionFailedJupyter, undefined, undefined, originalException, true); - } -} +export class JupyterSessionStartError extends WrappedError { + constructor(originalException: Error) { + super(originalException.message, originalException); + sendTelemetryEvent(Telemetry.StartSessionFailedJupyter, undefined, undefined, originalException, true); + } +} ``` @@ -8543,24 +8543,24 @@ No properties for event [src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) ```typescript - default: - // We don't know as its the default kernel on Jupyter server. - } - sendKernelTelemetryEvent(document.uri, Telemetry.SwitchKernel); - // If we have an existing kernel, then we know for a fact the user is changing the kernel. - // Else VSC is just setting a kernel for a notebook after it has opened. + default: + // We don't know as its the default kernel on Jupyter server. + } + sendKernelTelemetryEvent(document.uri, Telemetry.SwitchKernel); + // If we have an existing kernel, then we know for a fact the user is changing the kernel. + // Else VSC is just setting a kernel for a notebook after it has opened. if (existingKernel) { ``` [src/test/datascience/telemetry.vscode.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/telemetry.vscode.test.ts) ```typescript - // Right now this is the guaranteed list. Might want to expand this. - assertEvent(Telemetry.RunFileInteractive); - assertEvent(Telemetry.ExecuteCellPerceivedWarm); - assertEvent(Telemetry.SwitchKernel); - }); -}); + // Right now this is the guaranteed list. Might want to expand this. + assertEvent(Telemetry.RunFileInteractive); + assertEvent(Telemetry.ExecuteCellPerceivedWarm); + assertEvent(Telemetry.SwitchKernel); + }); +}); ``` @@ -8581,48 +8581,48 @@ No description provided [src/platform/common/utils.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/utils.ts) ```typescript -} - -export function sendNotebookOrKernelLanguageTelemetry( - telemetryEvent: Telemetry.SwitchToExistingKernel | Telemetry.NotebookLanguage, - language?: string -) { +} + +export function sendNotebookOrKernelLanguageTelemetry( + telemetryEvent: Telemetry.SwitchToExistingKernel | Telemetry.NotebookLanguage, + language?: string +) { language = getTelemetrySafeLanguage(language); ``` [src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) ```typescript - } - switch (this.connection.kind) { - case 'startUsingPythonInterpreter': - sendNotebookOrKernelLanguageTelemetry(Telemetry.SwitchToExistingKernel, PYTHON_LANGUAGE); - break; - case 'connectToLiveRemoteKernel': + } + switch (this.connection.kind) { + case 'startUsingPythonInterpreter': + sendNotebookOrKernelLanguageTelemetry(Telemetry.SwitchToExistingKernel, PYTHON_LANGUAGE); + break; + case 'connectToLiveRemoteKernel': sendNotebookOrKernelLanguageTelemetry( ``` [src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) ```typescript - break; - case 'connectToLiveRemoteKernel': - sendNotebookOrKernelLanguageTelemetry( - Telemetry.SwitchToExistingKernel, - this.connection.kernelModel.language - ); + break; + case 'connectToLiveRemoteKernel': + sendNotebookOrKernelLanguageTelemetry( + Telemetry.SwitchToExistingKernel, + this.connection.kernelModel.language + ); break; ``` [src/notebooks/controllers/vscodeNotebookController.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts) ```typescript - case 'startUsingLocalKernelSpec': - case 'startUsingRemoteKernelSpec': - sendNotebookOrKernelLanguageTelemetry( - Telemetry.SwitchToExistingKernel, - this.connection.kernelSpec.language - ); + case 'startUsingLocalKernelSpec': + case 'startUsingRemoteKernelSpec': + sendNotebookOrKernelLanguageTelemetry( + Telemetry.SwitchToExistingKernel, + this.connection.kernelSpec.language + ); break; ``` @@ -8741,12 +8741,12 @@ No properties for event [src/kernels/variables/jupyterVariables.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/jupyterVariables.ts) ```typescript - } - - // IJupyterVariables implementation - @captureTelemetry(Telemetry.VariableExplorerFetchTime, undefined, true) - public async getVariables(request: IJupyterVariablesRequest, kernel?: IKernel): Promise { - return this.variableHandler.getVariables(request, kernel); + } + + // IJupyterVariables implementation + @captureTelemetry(Telemetry.VariableExplorerFetchTime, undefined, true) + public async getVariables(request: IJupyterVariablesRequest, kernel?: IKernel): Promise { + return this.variableHandler.getVariables(request, kernel); } ``` @@ -8767,12 +8767,12 @@ No description provided [src/webviews/extension-side/variablesView/variableView.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/variablesView/variableView.ts) ```typescript - const response = await this.variables.getVariables(args, activeNotebook); - - this.postMessage(InteractiveWindowMessages.GetVariablesResponse, response).ignoreErrors(); - sendTelemetryEvent(Telemetry.VariableExplorerVariableCount, undefined, { - variableCount: response.totalCount - }); + const response = await this.variables.getVariables(args, activeNotebook); + + this.postMessage(InteractiveWindowMessages.GetVariablesResponse, response).ignoreErrors(); + sendTelemetryEvent(Telemetry.VariableExplorerVariableCount, undefined, { + variableCount: response.totalCount + }); } else { ``` @@ -8787,19 +8787,19 @@ No description provided ## Properties -- +- isErrorOutput: boolean; ## Locations Used [src/kernels/execution/helpers.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/helpers.ts) ```typescript - // Unless we already know its an unknown output type. - const outputType: nbformat.OutputType = - customMetadata?.outputType || (isStream ? 'stream' : 'display_data'); - sendTelemetryEvent(Telemetry.VSCNotebookCellTranslationFailed, undefined, { - isErrorOutput: outputType === 'error' - }); + // Unless we already know its an unknown output type. + const outputType: nbformat.OutputType = + customMetadata?.outputType || (isStream ? 'stream' : 'display_data'); + sendTelemetryEvent(Telemetry.VSCNotebookCellTranslationFailed, undefined, { + isErrorOutput: outputType === 'error' + }); ``` @@ -8822,12 +8822,12 @@ No properties for event [src/kernels/jupyter/session/jupyterSession.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/session/jupyterSession.ts) ```typescript - return true; - } - - @captureTelemetry(Telemetry.WaitForIdleJupyter, undefined, true) - public waitForIdle(timeout: number): Promise { - // Wait for idle on this session + return true; + } + + @captureTelemetry(Telemetry.WaitForIdleJupyter, undefined, true) + public waitForIdle(timeout: number): Promise { + // Wait for idle on this session return this.waitForIdleOnSession(this.session, timeout); ``` @@ -8852,12 +8852,12 @@ No properties for event [src/kernels/jupyter/serverSelector.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts) ```typescript - } - } else { - if (err.message.includes('Failed to fetch') && this.isWebExtension) { - sendTelemetryEvent(Telemetry.FetchError, undefined, { currentTask: 'connecting' }); - } - await this.errorHandler.handleError( + } + } else { + if (err.message.includes('Failed to fetch') && this.isWebExtension) { + sendTelemetryEvent(Telemetry.FetchError, undefined, { currentTask: 'connecting' }); + } + await this.errorHandler.handleError( new RemoteJupyterServerConnectionError(userURI, computeServerId(userURI), err) ``` @@ -8878,12 +8878,12 @@ No description provided [src/webviews/extension-side/webviewHost.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/webviewHost.ts) ```typescript - protected webViewRendered() { - if (this.webviewInit && !this.webviewInit.resolved) { - // Send telemetry for startup - sendTelemetryEvent(Telemetry.WebviewStartup, this.startupStopwatch.elapsedTime, { type: this.title }); - - // Resolve our started promise. This means the webpanel is ready to go. + protected webViewRendered() { + if (this.webviewInit && !this.webviewInit.resolved) { + // Send telemetry for startup + sendTelemetryEvent(Telemetry.WebviewStartup, this.startupStopwatch.elapsedTime, { type: this.title }); + + // Resolve our started promise. This means the webpanel is ready to go. this.webviewInit.resolve(); ``` @@ -8927,12 +8927,12 @@ No properties for event [src/kernels/raw/session/rawNotebookSupportedService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawNotebookSupportedService.node.ts) ```typescript - try { - require('zeromq'); - traceInfo(`ZMQ install verified.`); - sendTelemetryEvent(Telemetry.ZMQSupported); - this._isSupported = true; - } catch (e) { + try { + require('zeromq'); + traceInfo(`ZMQ install verified.`); + sendTelemetryEvent(Telemetry.ZMQSupported); + this._isSupported = true; + } catch (e) { traceError(`Exception while attempting zmq :`, e); ``` @@ -8957,12 +8957,12 @@ No properties for event [src/kernels/raw/session/rawNotebookSupportedService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawNotebookSupportedService.node.ts) ```typescript - this._isSupported = true; - } catch (e) { - traceError(`Exception while attempting zmq :`, e); - sendTelemetryEvent(Telemetry.ZMQNotSupported); - this._isSupported = false; - } + this._isSupported = true; + } catch (e) { + traceError(`Exception while attempting zmq :`, e); + sendTelemetryEvent(Telemetry.ZMQNotSupported); + this._isSupported = false; + } ``` @@ -8987,12 +8987,12 @@ No properties for event [src/platform/common/variables/environment.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/variables/environment.node.ts) ```typescript - }); - if (!invalid && replacement !== value) { - value = replacement; - sendTelemetryEvent(EventName.ENVFILE_VARIABLE_SUBSTITUTION); - } - + }); + if (!invalid && replacement !== value) { + value = replacement; + sendTelemetryEvent(EventName.ENVFILE_VARIABLE_SUBSTITUTION); + } + return value.replace(/\\\$/g, '$'); ``` @@ -9017,12 +9017,12 @@ No properties for event [src/telemetry/envFileTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/envFileTelemetry.node.ts) ```typescript -} - -function sendTelemetry(hasCustomEnvPath: boolean = false) { - sendTelemetryEvent(EventName.ENVFILE_WORKSPACE, undefined, { hasCustomEnvPath }); - - envFileTelemetrySent = true; +} + +function sendTelemetry(hasCustomEnvPath: boolean = false) { + sendTelemetryEvent(EventName.ENVFILE_WORKSPACE, undefined, { hasCustomEnvPath }); + + envFileTelemetrySent = true; } ``` @@ -9047,36 +9047,36 @@ No properties for event [src/telemetry/startupTelemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/startupTelemetry.ts) ```typescript - await activatedPromise; - durations.totalActivateTime = stopWatch.elapsedTime; - const props = await getActivationTelemetryProps(serviceContainer); - sendTelemetryEvent(EventName.EXTENSION_LOAD, durations, props); - } catch (ex) { - traceError('sendStartupTelemetry() failed.', ex); + await activatedPromise; + durations.totalActivateTime = stopWatch.elapsedTime; + const props = await getActivationTelemetryProps(serviceContainer); + sendTelemetryEvent(EventName.EXTENSION_LOAD, durations, props); + } catch (ex) { + traceError('sendStartupTelemetry() failed.', ex); } ``` [src/telemetry/startupTelemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/startupTelemetry.ts) ```typescript - traceError('getActivationTelemetryProps() failed.', ex); - } - } - sendTelemetryEvent(EventName.EXTENSION_LOAD, durations, props, ex); - } catch (exc2) { - traceError('sendErrorTelemetry() failed.', exc2); + traceError('getActivationTelemetryProps() failed.', ex); + } + } + sendTelemetryEvent(EventName.EXTENSION_LOAD, durations, props, ex); + } catch (exc2) { + traceError('sendErrorTelemetry() failed.', exc2); } ``` [src/telemetry/startupTelemetry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/startupTelemetry.ts) ```typescript - -async function getActivationTelemetryProps( - serviceContainer: IServiceContainer -): Promise { - // eslint-disable-next-line - // TODO: Not all of this data is showing up in the database... + +async function getActivationTelemetryProps( + serviceContainer: IServiceContainer +): Promise { + // eslint-disable-next-line + // TODO: Not all of this data is showing up in the database... // eslint-disable-next-line ``` @@ -9101,24 +9101,24 @@ No properties for event [src/webviews/extension-side/importTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/importTracker.node.ts) ```typescript - // Hash the package name so that we will never accidentally see a - // user's private package name. - const hash = getTelemetrySafeHashedString(packageName); - sendTelemetryEvent(EventName.HASHED_PACKAGE_NAME, undefined, { hashedNamev2: hash }); - } - + // Hash the package name so that we will never accidentally see a + // user's private package name. + const hash = getTelemetrySafeHashedString(packageName); + sendTelemetryEvent(EventName.HASHED_PACKAGE_NAME, undefined, { hashedNamev2: hash }); + } + private lookForImports(lines: (string | undefined)[]) { ``` [src/test/telemetry/importTracker.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/telemetry/importTracker.unit.test.ts) ```typescript - public static expectHashes(...hashes: string[]) { - expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_PERF); - if (hashes.length > 0) { - expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_NAME); - } - + public static expectHashes(...hashes: string[]) { + expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_PERF); + if (hashes.length > 0) { + expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_NAME); + } + Reporter.properties.pop(); // HASHED_PACKAGE_PERF ``` @@ -9141,48 +9141,48 @@ No properties for event [src/webviews/extension-side/importTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/importTracker.node.ts) ```typescript - } - } - - @captureTelemetry(EventName.HASHED_PACKAGE_PERF) - private checkNotebookDocument(e: NotebookDocument) { - this.pendingChecks.delete(e.uri.fsPath); + } + } + + @captureTelemetry(EventName.HASHED_PACKAGE_PERF) + private checkNotebookDocument(e: NotebookDocument) { + this.pendingChecks.delete(e.uri.fsPath); const lines = this.getNotebookDocumentLines(e); ``` [src/webviews/extension-side/importTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/importTracker.node.ts) ```typescript - this.lookForImports(lines); - } - - @captureTelemetry(EventName.HASHED_PACKAGE_PERF) - private checkNotebookCell(e: NotebookCellExecutionStateChangeEvent) { - if (!isJupyterNotebook(e.cell.notebook)) { + this.lookForImports(lines); + } + + @captureTelemetry(EventName.HASHED_PACKAGE_PERF) + private checkNotebookCell(e: NotebookCellExecutionStateChangeEvent) { + if (!isJupyterNotebook(e.cell.notebook)) { return; ``` [src/webviews/extension-side/importTracker.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/importTracker.node.ts) ```typescript - this.lookForImports(result); - } - - @captureTelemetry(EventName.HASHED_PACKAGE_PERF) - private checkDocument(document: TextDocument) { - this.pendingChecks.delete(document.fileName); + this.lookForImports(result); + } + + @captureTelemetry(EventName.HASHED_PACKAGE_PERF) + private checkDocument(document: TextDocument) { + this.pendingChecks.delete(document.fileName); const lines = this.getDocumentLines(document); ``` [src/test/telemetry/importTracker.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/telemetry/importTracker.unit.test.ts) ```typescript - public static measures: {}[] = []; - - public static expectHashes(...hashes: string[]) { - expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_PERF); - if (hashes.length > 0) { - expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_NAME); + public static measures: {}[] = []; + + public static expectHashes(...hashes: string[]) { + expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_PERF); + if (hashes.length > 0) { + expect(Reporter.eventNames).to.contain(EventName.HASHED_PACKAGE_NAME); } ``` @@ -9207,48 +9207,48 @@ No properties for event [src/platform/common/experiments/service.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/experiments/service.ts) ```typescript - // so we need to perform these checks and send the corresponding telemetry manually. - switch (this.getOptInOptOutStatus(experiment)) { - case 'optOut': { - sendTelemetryEvent(EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, undefined, { - expNameOptedOutOf: experiment - }); + // so we need to perform these checks and send the corresponding telemetry manually. + switch (this.getOptInOptOutStatus(experiment)) { + case 'optOut': { + sendTelemetryEvent(EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, undefined, { + expNameOptedOutOf: experiment + }); ``` [src/platform/common/experiments/service.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/experiments/service.ts) ```typescript - } - case 'optIn': { - await this.experimentationService.isCachedFlightEnabled(experiment); - sendTelemetryEvent(EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, undefined, { - expNameOptedInto: experiment - }); + } + case 'optIn': { + await this.experimentationService.isCachedFlightEnabled(experiment); + sendTelemetryEvent(EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, undefined, { + expNameOptedInto: experiment + }); ``` [src/test/common/experiments/service.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/common/experiments/service.unit.test.ts) ```typescript - assert.isTrue(result); - assert.equal(telemetryEvents.length, 1); - assert.deepEqual(telemetryEvents[0], { - eventName: EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, - properties: { expNameOptedInto: experiment } - }); + assert.isTrue(result); + assert.equal(telemetryEvents.length, 1); + assert.deepEqual(telemetryEvents[0], { + eventName: EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, + properties: { expNameOptedInto: experiment } + }); sinon.assert.calledOnce(isCachedFlightEnabledStub); ``` [src/test/common/experiments/service.unit.test.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/common/experiments/service.unit.test.ts) ```typescript - assert.isFalse(result); - assert.equal(telemetryEvents.length, 1); - assert.deepEqual(telemetryEvents[0], { - eventName: EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, - properties: { expNameOptedOutOf: experiment } - }); + assert.isFalse(result); + assert.equal(telemetryEvents.length, 1); + assert.deepEqual(telemetryEvents[0], { + eventName: EventName.JUPYTER_EXPERIMENTS_OPT_IN_OUT, + properties: { expNameOptedOutOf: experiment } + }); sinon.assert.notCalled(isCachedFlightEnabledStub); ``` @@ -9271,48 +9271,48 @@ No properties for event [src/kernels/jupyter/jupyterDetectionTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterDetectionTelemetry.node.ts) ```typescript - const minor = parseInt(versionMatch[2], 10); - const frontEndVersion = parseFloat(`${major}.${minor}`); - if (shell) { - sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { - frontEnd, - frontEndVersion, + const minor = parseInt(versionMatch[2], 10); + const frontEndVersion = parseFloat(`${major}.${minor}`); + if (shell) { + sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { + frontEnd, + frontEndVersion, detection: 'shell', ``` [src/kernels/jupyter/jupyterDetectionTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterDetectionTelemetry.node.ts) ```typescript - shellType: shell - }); - } else { - sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { - frontEnd, - frontEndVersion, + shellType: shell + }); + } else { + sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { + frontEnd, + frontEndVersion, detection: 'process' ``` [src/kernels/jupyter/jupyterDetectionTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterDetectionTelemetry.node.ts) ```typescript - }); - } - } else { - sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { - failed: true, - reason: 'notInstalled', + }); + } + } else { + sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { + failed: true, + reason: 'notInstalled', frontEnd ``` [src/kernels/jupyter/jupyterDetectionTelemetry.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterDetectionTelemetry.node.ts) ```typescript - }); - } - } catch (ex) { - sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { - failed: true, - reason: 'notInstalled', + }); + } + } catch (ex) { + sendTelemetryEvent(Telemetry.JupyterInstalled, undefined, { + failed: true, + reason: 'notInstalled', frontEnd ``` @@ -9335,12 +9335,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts) ```typescript - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS); - } - } catch (e) { - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR, undefined, undefined, e); - traceError(e); - this.errorHandler.handleError(e).then(noop, noop); + sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS); + } + } catch (e) { + sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR, undefined, undefined, e); + traceError(e); + this.errorHandler.handleError(e).then(noop, noop); } ``` @@ -9363,12 +9363,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts) ```typescript - this.disposables.push(disposable); - } - private async onVariablePanelShowDataViewerRequest(request: IShowDataViewerFromVariablePanel) { - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST); - if ( - this.debugService?.activeDebugSession && + this.disposables.push(disposable); + } + private async onVariablePanelShowDataViewerRequest(request: IShowDataViewerFromVariablePanel) { + sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST); + if ( + this.debugService?.activeDebugSession && this.variableProvider && ``` @@ -9391,12 +9391,12 @@ No properties for event [src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts) ```typescript - if (columnSize && (await this.dataViewerChecker.isRequestedColumnSizeAllowed(columnSize))) { - const title: string = `${DataScience.dataExplorerTitle()} - ${jupyterVariable.name}`; - await this.dataViewerFactory.create(jupyterVariableDataProvider, title); - sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS); - } - } catch (e) { + if (columnSize && (await this.dataViewerChecker.isRequestedColumnSizeAllowed(columnSize))) { + const title: string = `${DataScience.dataExplorerTitle()} - ${jupyterVariable.name}`; + await this.dataViewerFactory.create(jupyterVariableDataProvider, title); + sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS); + } + } catch (e) { sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR, undefined, undefined, e); ``` @@ -9421,36 +9421,36 @@ No properties for event [src/platform/common/platform/platformService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.node.ts) ```typescript - public version?: SemVer; - constructor() { - if (this.osType === OSType.Unknown) { - sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { - failureType: PlatformErrors.FailedToDetermineOS - }); + public version?: SemVer; + constructor() { + if (this.osType === OSType.Unknown) { + sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { + failureType: PlatformErrors.FailedToDetermineOS + }); } ``` [src/platform/common/platform/platformService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.node.ts) ```typescript - try { - const ver = coerce(os.release()); - if (ver) { - sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { - osVersion: `${ver.major}.${ver.minor}.${ver.patch}` - }); + try { + const ver = coerce(os.release()); + if (ver) { + sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { + osVersion: `${ver.major}.${ver.minor}.${ver.patch}` + }); return (this.version = ver); ``` [src/platform/common/platform/platformService.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.node.ts) ```typescript - } - throw new Error('Unable to parse version'); - } catch (ex) { - sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { - failureType: PlatformErrors.FailedToParseVersion - }); + } + throw new Error('Unable to parse version'); + } catch (ex) { + sendTelemetryEvent(EventName.PLATFORM_INFO, undefined, { + failureType: PlatformErrors.FailedToParseVersion + }); return parseVersion(os.release()); ``` @@ -9465,46 +9465,46 @@ No description provided ## Properties -- - /** - * Carries `true` if environment variables are present, `false` otherwise - * - * @type {boolean} - */ +- + /** + * Carries `true` if environment variables are present, `false` otherwise + * + * @type {boolean} + */ hasEnvVars?: boolean; -- - /** - * Carries `true` if fetching environment variables failed, `false` otherwise - * - * @type {boolean} - */ +- + /** + * Carries `true` if fetching environment variables failed, `false` otherwise + * + * @type {boolean} + */ failed?: boolean; -- - /** - * Whether the environment was activated within a terminal or not. - * - * @type {boolean} - */ +- + /** + * Whether the environment was activated within a terminal or not. + * + * @type {boolean} + */ activatedInTerminal?: boolean; -- - /** - * Whether the environment was activated by the wrapper class. - * If `true`, this telemetry is sent by the class that wraps the two activation providers . - * - * @type {boolean} - */ +- + /** + * Whether the environment was activated by the wrapper class. + * If `true`, this telemetry is sent by the class that wraps the two activation providers . + * + * @type {boolean} + */ activatedByWrapper?: boolean; ## Locations Used [src/platform/common/process/pythonExecutionFactory.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/pythonExecutionFactory.node.ts) ```typescript - options.allowEnvironmentFetchExceptions - ); - const hasEnvVars = envVars && Object.keys(envVars).length > 0; - sendTelemetryEvent(EventName.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES, undefined, { hasEnvVars }); - if (!hasEnvVars) { - return this.create({ + options.allowEnvironmentFetchExceptions + ); + const hasEnvVars = envVars && Object.keys(envVars).length > 0; + sendTelemetryEvent(EventName.PYTHON_INTERPRETER_ACTIVATION_ENVIRONMENT_VARIABLES, undefined, { hasEnvVars }); + if (!hasEnvVars) { + return this.create({ resource: options.resource, ``` @@ -9529,24 +9529,24 @@ No properties for event [src/platform/terminals/helper.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/terminals/helper.node.ts) ```typescript - terminal?: Terminal - ): Promise<{ env?: NodeJS.ProcessEnv; shell: TerminalShellType }> { - if (this.platform.osType === OSType.Unknown) { - sendTelemetryEvent(Telemetry.TerminalEnvVariableExtraction, undefined, { - failed: true, - reason: 'unknownOs', + terminal?: Terminal + ): Promise<{ env?: NodeJS.ProcessEnv; shell: TerminalShellType }> { + if (this.platform.osType === OSType.Unknown) { + sendTelemetryEvent(Telemetry.TerminalEnvVariableExtraction, undefined, { + failed: true, + reason: 'unknownOs', shellType: undefined ``` [src/platform/terminals/helper.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/terminals/helper.node.ts) ```typescript - return { env, shell }; - } catch (ex) { - traceError('Failed to extract environment variables', ex); - sendTelemetryEvent(Telemetry.TerminalEnvVariableExtraction, undefined, { - failed: true, - reason: failureReason, + return { env, shell }; + } catch (ex) { + traceError('Failed to extract environment variables', ex); + sendTelemetryEvent(Telemetry.TerminalEnvVariableExtraction, undefined, { + failed: true, + reason: failureReason, shellType: shell ``` @@ -9579,29 +9579,29 @@ No properties for event ## Properties -- +- failed: boolean; -- +- reason: 'unknownShell' | undefined; -- +- terminalProvided: boolean; -- +- shellIdentificationSource: 'terminalName' | 'settings' | 'environment' | 'default' | 'vscode'; -- +- hasCustomShell: undefined | boolean; -- +- hasShellInEnv: undefined | boolean; ## Locations Used [src/platform/terminals/shellDetector.node.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/terminals/shellDetector.node.ts) ```typescript - // This information is useful in determining how well we identify shells on users machines. - // This impacts executing code in terminals and activation of environments in terminal. - // So, the better this works, the better it is for the user. - sendTelemetryEvent(Telemetry.TerminalShellIdentification, undefined, telemetryProperties); - traceVerbose(`Shell identified as '${shell}'`); - + // This information is useful in determining how well we identify shells on users machines. + // This impacts executing code in terminals and activation of environments in terminal. + // So, the better this works, the better it is for the user. + sendTelemetryEvent(Telemetry.TerminalShellIdentification, undefined, telemetryProperties); + traceVerbose(`Shell identified as '${shell}'`); + // If we could not identify the shell, use the defaults. ``` diff --git a/news/1 Enhancements/10291.md b/news/1 Enhancements/10291.md new file mode 100644 index 00000000000..ba7b1f567ba --- /dev/null +++ b/news/1 Enhancements/10291.md @@ -0,0 +1 @@ +Enabled export Interactive Window for web. diff --git a/package.json b/package.json index 184831a5656..80d267c1158 100644 --- a/package.json +++ b/package.json @@ -816,7 +816,7 @@ "title": "%DataScience.exportDialogTitle%", "shortTitle": "%DataScience.exportAsNotebook.shorttitle%", "icon": "$(save-as)", - "enablement": "notebookType == interactive && !jupyter.webExtension", + "enablement": "notebookType == interactive", "category": "Jupyter" }, { @@ -826,7 +826,7 @@ "light": "resources/light/export_to_python.svg", "dark": "resources/dark/export_to_python.svg" }, - "enablement": "notebookType == interactive && !jupyter.webExtension", + "enablement": "notebookType == interactive", "category": "Jupyter" }, { diff --git a/src/interactive-window/interactiveWindow.ts b/src/interactive-window/interactiveWindow.ts index 05fff2fcb0a..194c8cb5daa 100644 --- a/src/interactive-window/interactiveWindow.ts +++ b/src/interactive-window/interactiveWindow.ts @@ -21,7 +21,6 @@ import { NotebookController, NotebookEdit } from 'vscode'; -import { IPythonExtensionChecker } from '../platform/api/types'; import { IApplicationShell, ICommandManager, @@ -117,11 +116,10 @@ export class InteractiveWindow implements IInteractiveWindowLoadable { private readonly fs: IFileSystem, private readonly configuration: IConfigurationService, private readonly commandManager: ICommandManager, - private readonly jupyterExporter: INotebookExporter | undefined, + private readonly jupyterExporter: INotebookExporter, private readonly workspaceService: IWorkspaceService, private _owner: Resource, private mode: InteractiveWindowMode, - private readonly extensionChecker: IPythonExtensionChecker, private readonly exportDialog: IExportDialog, private readonly notebookControllerManager: INotebookControllerManager, private readonly serviceContainer: IServiceContainer, @@ -777,13 +775,7 @@ export class InteractiveWindow implements IInteractiveWindowLoadable { await workspace.applyEdit(edit); } - // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-empty,@typescript-eslint/no-empty-function public async export() { - // Export requires the python extension - if (!this.extensionChecker.isPythonExtensionInstalled) { - return this.extensionChecker.showPythonExtensionInstallRequiredPrompt(); - } - const { magicCommandsAsComments } = this.configuration.getSettings(this.owningResource); const cells = generateCellsFromNotebookDocument(this.notebookEditor.notebook, magicCommandsAsComments); @@ -799,10 +791,6 @@ export class InteractiveWindow implements IInteractiveWindowLoadable { public async exportAs() { const kernel = await this.startKernel(); - // Export requires the python extension - if (!this.extensionChecker.isPythonExtensionInstalled) { - return this.extensionChecker.showPythonExtensionInstallRequiredPrompt(); - } // Pull out the metadata from our active notebook const metadata: nbformat.INotebookMetadata = { orig_nbformat: defaultNotebookFormat.major }; @@ -818,13 +806,24 @@ export class InteractiveWindow implements IInteractiveWindowLoadable { } // Then run the export command with these contents - this.commandManager - .executeCommand( - Commands.Export, - this.notebookDocument, - defaultFileName, - kernel?.kernelConnectionMetadata.interpreter - ) - .then(noop, noop); + if (this.isWebExtension) { + // In web, we currently only support exporting as python script + this.commandManager + .executeCommand( + Commands.ExportAsPythonScript, + this.notebookDocument, + kernel?.kernelConnectionMetadata.interpreter + ) + .then(noop, noop); + } else { + this.commandManager + .executeCommand( + Commands.Export, + this.notebookDocument, + defaultFileName, + kernel?.kernelConnectionMetadata.interpreter + ) + .then(noop, noop); + } } } diff --git a/src/interactive-window/interactiveWindowProvider.ts b/src/interactive-window/interactiveWindowProvider.ts index 36df253b6c3..8d3faef8d1f 100644 --- a/src/interactive-window/interactiveWindowProvider.ts +++ b/src/interactive-window/interactiveWindowProvider.ts @@ -13,7 +13,6 @@ import { ViewColumn, window } from 'vscode'; -import { IPythonExtensionChecker } from '../platform/api/types'; import { IApplicationShell, @@ -174,11 +173,10 @@ export class InteractiveWindowProvider this.serviceContainer.get(IFileSystem), this.serviceContainer.get(IConfigurationService), commandManager, - this.serviceContainer.tryGet(INotebookExporter), + this.serviceContainer.get(INotebookExporter), this.serviceContainer.get(IWorkspaceService), resource, mode, - this.serviceContainer.get(IPythonExtensionChecker), this.serviceContainer.get(IExportDialog), this.notebookControllerManager, this.serviceContainer, diff --git a/src/test/datascience/interactiveWindow.vscode.test.ts b/src/test/datascience/interactiveWindow.vscode.test.ts index fdaa5a01189..39b0733c795 100644 --- a/src/test/datascience/interactiveWindow.vscode.test.ts +++ b/src/test/datascience/interactiveWindow.vscode.test.ts @@ -8,18 +8,30 @@ import { traceInfo } from '../../platform/logging'; import { getDisplayPath, getFilePath } from '../../platform/common/platform/fs-paths'; import { IDisposable } from '../../platform/common/types'; import { InteractiveWindowProvider } from '../../interactive-window/interactiveWindowProvider'; -import { captureScreenShot, IExtensionTestApi } from '../common.node'; +import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../common.node'; import { initialize, IS_REMOTE_NATIVE_TEST, IS_CONDA_TEST } from '../initialize.node'; import { closeInteractiveWindow, + createStandaloneInteractiveWindow, + insertIntoInputEditor, installIPyKernel, runCurrentFile, runNewPythonFile, setActiveInterpreter, uninstallIPyKernel, + waitForInteractiveWindow, waitForLastCellToComplete } from './helpers.node'; -import { closeNotebooksAndCleanUpAfterTests, startJupyterServer } from './notebook/helper.node'; +import { + closeNotebooksAndCleanUpAfterTests, + defaultNotebookTestTimeout, + generateTemporaryFilePath, + hijackPrompt, + hijackSavePrompt, + startJupyterServer, + waitForTextOutput, + WindowPromptStubButtonClickOptions +} from './notebook/helper.node'; import { INotebookControllerManager } from '../../notebooks/types'; import { IInteractiveWindowProvider } from '../../interactive-window/types'; import { IInterpreterService } from '../../platform/interpreter/contracts'; @@ -27,6 +39,8 @@ import { areInterpreterPathsSame } from '../../platform/pythonEnvironments/info/ import { IPythonApiProvider } from '../../platform/api/types'; import { isEqual } from '../../platform/vscode-path/resources'; import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { IVSCodeNotebook } from '../../platform/common/application/types'; +import { Commands } from '../../platform/common/constants'; suite(`Interactive window`, async function () { this.timeout(120_000); @@ -153,6 +167,50 @@ suite(`Interactive window`, async function () { } }); + test('Export Interactive window to Notebook', async () => { + const activeInteractiveWindow = await createStandaloneInteractiveWindow(interactiveWindowProvider); + await waitForInteractiveWindow(activeInteractiveWindow); + + // Add a few cells from the input box + await insertIntoInputEditor('print("first")'); + await vscode.commands.executeCommand('interactive.execute'); + await insertIntoInputEditor('print("second")'); + await vscode.commands.executeCommand('interactive.execute'); + await insertIntoInputEditor('print("third")'); + await vscode.commands.executeCommand('interactive.execute'); + + await waitForLastCellToComplete(activeInteractiveWindow, 3, false); + let notebookFile = await generateTemporaryFilePath('ipynb', disposables); + const promptOptions: WindowPromptStubButtonClickOptions = { + result: notebookFile, + clickImmediately: true + }; + let savePrompt = await hijackSavePrompt('Export', promptOptions, disposables); + let openFilePrompt = await hijackPrompt( + 'showInformationMessage', + { contains: 'Notebook written to' }, + { dismissPrompt: false }, + disposables + ); + + await vscode.commands.executeCommand(Commands.InteractiveExportAsNotebook, activeInteractiveWindow.notebookUri); + + await waitForCondition(() => savePrompt.displayed, defaultNotebookTestTimeout, 'save Prompt not displayed'); + await waitForCondition( + () => openFilePrompt.displayed, + defaultNotebookTestTimeout, + 'open file Prompt not displayed' + ); + + const vscodeNotebook = api.serviceContainer.get(IVSCodeNotebook); + await vscodeNotebook.openNotebookDocument(notebookFile); + let editor = await vscodeNotebook.showNotebookDocument(notebookFile, { preserveFocus: false }); + + const cells = editor.notebook.getCells(); + assert.strictEqual(cells?.length, 3); + await waitForTextOutput(cells[0], 'first'); + }); + // todo@joyceerhl // test('Verify CWD', () => { }); // test('Multiple executes go to last active window', async () => { }); diff --git a/src/test/datascience/jupyter/kernels/installationPrompts.vscode.test.ts b/src/test/datascience/jupyter/kernels/installationPrompts.vscode.test.ts index c5fe4a10c5b..ef3640a692f 100644 --- a/src/test/datascience/jupyter/kernels/installationPrompts.vscode.test.ts +++ b/src/test/datascience/jupyter/kernels/installationPrompts.vscode.test.ts @@ -331,7 +331,7 @@ suite('DataScience Install IPyKernel (slow) (install)', function () { // Next, lets try to run again, but select a kernel that doesn't have ipykernel. // At this point we should get the prompt again for this new kernel. const promptOptions: WindowPromptStubButtonClickOptions = { - text: DataScience.selectKernel(), + result: DataScience.selectKernel(), clickImmediately: true }; prompt = await hijackPrompt( @@ -345,7 +345,7 @@ suite('DataScience Install IPyKernel (slow) (install)', function () { const stub = sinon.stub(kernelSelector, 'selectKernel').callsFake(async function () { // Now that we have selected a kernel, next time we get the prompt again, just dismiss the prompt. promptOptions.dismissPrompt = true; - delete promptOptions.text; + delete promptOptions.result; // In tests, things hang as the IW isn't focused. activeInteractiveWindow.show(false).then(noop, noop); await waitForKernelToChange({ interpreterPath: venvNoRegPath, isInteractiveController: true }); @@ -403,7 +403,7 @@ suite('DataScience Install IPyKernel (slow) (install)', function () { // Now install ipykernel and ensure we can run a cell & that it runs against the right environment. prompt.reset(); promptOptions.dismissPrompt = false; - promptOptions.text = Common.install(); + promptOptions.result = Common.install(); await activeInteractiveWindow .addCode(`import sys${EOL}print(sys.executable)`, untitledPythonFile.uri, 0) @@ -636,7 +636,7 @@ suite('DataScience Install IPyKernel (slow) (install)', function () { const prompt = await hijackPrompt( 'showInformationMessage', { contains: expectedPromptMessageSuffix }, - { text: DataScience.selectKernel(), clickImmediately: true }, + { result: DataScience.selectKernel(), clickImmediately: true }, disposables ); @@ -750,7 +750,7 @@ suite('DataScience Install IPyKernel (slow) (install)', function () { return hijackPrompt( 'showInformationMessage', { contains: expectedPromptMessageSuffix }, - { text: DataScience.selectKernel(), clickImmediately: true }, + { result: DataScience.selectKernel(), clickImmediately: true }, disposables ); } @@ -758,7 +758,7 @@ suite('DataScience Install IPyKernel (slow) (install)', function () { return hijackPrompt( 'showInformationMessage', { contains: expectedPromptMessageSuffix }, - { text: Common.install(), clickImmediately: true }, + { result: Common.install(), clickImmediately: true }, disposables ); } diff --git a/src/test/datascience/notebook/executionService.vscode.test.ts b/src/test/datascience/notebook/executionService.vscode.test.ts index 46afba5ab25..abee3f63c17 100644 --- a/src/test/datascience/notebook/executionService.vscode.test.ts +++ b/src/test/datascience/notebook/executionService.vscode.test.ts @@ -87,7 +87,7 @@ suite('DataScience - VSCode Notebook - (Execution) (slow)', function () { await hijackPrompt( 'showErrorMessage', { endsWith: expectedPromptMessageSuffix }, - { text: Common.install(), clickImmediately: true }, + { result: Common.install(), clickImmediately: true }, disposables ); diff --git a/src/test/datascience/notebook/exportFull.vscode.test.ts b/src/test/datascience/notebook/exportFull.vscode.test.ts index d2ce40d4ca3..3f151b84c97 100644 --- a/src/test/datascience/notebook/exportFull.vscode.test.ts +++ b/src/test/datascience/notebook/exportFull.vscode.test.ts @@ -69,7 +69,7 @@ suite('DataScience - VSCode Notebook - (Export) (slow)', function () { await hijackPrompt( 'showErrorMessage', { endsWith: expectedPromptMessageSuffix }, - { text: Common.install(), clickImmediately: true }, + { result: Common.install(), clickImmediately: true }, disposables ); diff --git a/src/test/datascience/notebook/helper.ts b/src/test/datascience/notebook/helper.ts index a2196490a92..8015776acce 100644 --- a/src/test/datascience/notebook/helper.ts +++ b/src/test/datascience/notebook/helper.ts @@ -158,6 +158,18 @@ async function createTemporaryNotebookFromNotebook( disposables: IDisposable[], rootFolder?: Uri, prefix?: string +) { + const uri = await generateTemporaryFilePath('.ipynb', disposables, rootFolder, prefix); + await workspace.fs.writeFile(uri, Buffer.from(JSON.stringify(notebook))); + + return uri; +} + +export async function generateTemporaryFilePath( + extension: string, + disposables: IDisposable[], + rootFolder?: Uri, + prefix?: string ) { const services = await getServices(); const platformService = services.serviceContainer.get(IPlatformService); @@ -167,14 +179,14 @@ async function createTemporaryNotebookFromNotebook( platformService.tempDir || workspaceService.rootFolder || Uri.file('./').with({ scheme: 'vscode-test-web' }); - const uri = urlPath.joinPath(rootUrl, `${prefix || ''}${uuid()}.ipynb`); - await workspace.fs.writeFile(uri, Buffer.from(JSON.stringify(notebook))); + const uri = urlPath.joinPath(rootUrl, `${prefix || ''}${uuid()}.${extension}`); disposables.push({ dispose: () => { void workspace.fs.delete(uri).then(noop, noop); } }); + return uri; } @@ -959,7 +971,7 @@ export type WindowPromptStub = { getDisplayCount(): number; }; export type WindowPromptStubButtonClickOptions = { - text?: string; + result?: string | Uri; clickImmediately?: boolean; dismissPrompt?: boolean; }; @@ -976,7 +988,7 @@ export async function hijackPrompt( const api = await initialize(); const appShell = api.serviceContainer.get(IApplicationShell); let displayed = createDeferred(); - let clickButton = createDeferred(); + let clickButton = createDeferred(); const messageDisplayed: string[] = []; let displayCount = 0; // eslint-disable-next-line @@ -992,11 +1004,11 @@ export async function hijackPrompt( displayCount += 1; displayed.resolve(true); if (buttonToClick) { - if (!buttonToClick.dismissPrompt && buttonToClick?.clickImmediately === true && buttonToClick.text) { + if (!buttonToClick.dismissPrompt && buttonToClick?.clickImmediately === true && buttonToClick.result) { if (clickButton.completed) { clickButton = createDeferred(); } - clickButton.resolve(buttonToClick.text); + clickButton.resolve(buttonToClick.result); } return buttonToClick.dismissPrompt ? Promise.resolve(undefined) : clickButton.promise; } @@ -1022,7 +1034,61 @@ export async function hijackPrompt( displayCount = 0; displayed = createDeferred(); }, - clickButton: (text?: string) => clickButton.resolve(text || buttonToClick?.text) + clickButton: (text?: string) => clickButton.resolve(text || buttonToClick?.result) + }; +} + +export async function hijackSavePrompt( + saveLabel: string, + buttonToClick?: WindowPromptStubButtonClickOptions, + disposables: IDisposable[] = [] +): Promise { + const api = await initialize(); + const appShell = api.serviceContainer.get(IApplicationShell); + let displayed = createDeferred(); + let clickButton = createDeferred(); + const messageDisplayed: string[] = []; + let displayCount = 0; + // eslint-disable-next-line + const stub = sinon.stub(appShell, 'showSaveDialog').callsFake(function (msg: { saveLabel: string }) { + traceInfo(`Message displayed to user '${JSON.stringify(msg)}', checking for '${saveLabel}'`); + if (msg.saveLabel === saveLabel) { + messageDisplayed.push(msg.saveLabel); + traceInfo(`Exact Message found '${msg}'`); + displayCount += 1; + displayed.resolve(true); + if (buttonToClick) { + if (!buttonToClick.dismissPrompt && buttonToClick?.clickImmediately === true && buttonToClick.result) { + if (clickButton.completed) { + clickButton = createDeferred(); + } + clickButton.resolve(buttonToClick.result); + } + return buttonToClick.dismissPrompt ? Promise.resolve(undefined) : clickButton.promise; + } + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (appShell.showSaveDialog as any).wrappedMethod.apply(appShell, arguments); + } as any); + const disposable = { dispose: () => stub.restore() }; + if (disposables) { + disposables.push(disposable); + } + return { + dispose: () => stub.restore(), + getDisplayCount: () => displayCount, + get displayed() { + return displayed.promise; + }, + get messages() { + return messageDisplayed; + }, + reset: () => { + messageDisplayed.splice(0, messageDisplayed.length); + displayCount = 0; + displayed = createDeferred(); + }, + clickButton: (text?: string) => clickButton.resolve(text || buttonToClick?.result) }; } diff --git a/src/test/datascience/notebook/kernelCrashes.vscode.test.ts b/src/test/datascience/notebook/kernelCrashes.vscode.test.ts index c55755187e6..3abde0b873b 100644 --- a/src/test/datascience/notebook/kernelCrashes.vscode.test.ts +++ b/src/test/datascience/notebook/kernelCrashes.vscode.test.ts @@ -227,7 +227,7 @@ suite('DataScience - VSCode Notebook Kernel Error Handling - (Execution) (slow)' { exactMatch: expectedErrorMessage }, - { text: DataScience.restartKernel(), clickImmediately: true }, + { result: DataScience.restartKernel(), clickImmediately: true }, disposables ); // Confirm we get a prompt to restart the kernel, and it gets restarted. @@ -268,7 +268,7 @@ suite('DataScience - VSCode Notebook Kernel Error Handling - (Execution) (slow)' { exactMatch: expectedErrorMessage }, - { text: DataScience.restartKernel(), clickImmediately: true }, + { result: DataScience.restartKernel(), clickImmediately: true }, disposables ); // Confirm we get a prompt to restart the kernel, and it gets restarted. @@ -291,7 +291,7 @@ suite('DataScience - VSCode Notebook Kernel Error Handling - (Execution) (slow)' { exactMatch: expectedErrorMessage }, - { text: DataScience.restartKernel(), clickImmediately: true }, + { result: DataScience.restartKernel(), clickImmediately: true }, disposables ); // Confirm we get a prompt to restart the kernel, and it gets restarted. diff --git a/src/test/datascience/notebook/remoteNotebookEditor.vscode.test.ts b/src/test/datascience/notebook/remoteNotebookEditor.vscode.test.ts index 844693a42e3..734b88ac6e7 100644 --- a/src/test/datascience/notebook/remoteNotebookEditor.vscode.test.ts +++ b/src/test/datascience/notebook/remoteNotebookEditor.vscode.test.ts @@ -279,7 +279,7 @@ suite('DataScience - VSCode Notebook - (Remote Execution)', function () { const prompt = await hijackPrompt( 'showErrorMessage', { contains: 'certificate' }, - { text: DataScience.jupyterSelfCertEnable(), clickImmediately: true } + { result: DataScience.jupyterSelfCertEnable(), clickImmediately: true } ); await startJupyterServer(undefined, true); await openNotebook(ipynbFile); diff --git a/src/webviews/extension-side/import-export/jupyterExporter.node.ts b/src/webviews/extension-side/import-export/jupyterExporter.ts similarity index 97% rename from src/webviews/extension-side/import-export/jupyterExporter.node.ts rename to src/webviews/extension-side/import-export/jupyterExporter.ts index fd4e8dc013c..8a880d19e1f 100644 --- a/src/webviews/extension-side/import-export/jupyterExporter.node.ts +++ b/src/webviews/extension-side/import-export/jupyterExporter.ts @@ -8,7 +8,7 @@ import { Uri } from 'vscode'; import { CellMatcher } from '../../../interactive-window/editor-integration/cellMatcher'; import { IApplicationShell } from '../../../platform/common/application/types'; import { traceError } from '../../../platform/logging'; -import { IFileSystemNode } from '../../../platform/common/platform/types.node'; +import { IFileSystem } from '../../../platform/common/platform/types'; import { ICell, IConfigurationService } from '../../../platform/common/types'; import { pruneCell } from '../../../platform/common/utils'; import { DataScience } from '../../../platform/common/utils/localize'; @@ -23,7 +23,7 @@ export class JupyterExporter implements INotebookExporter { constructor( @inject(IJupyterExecution) private jupyterExecution: IJupyterExecution, @inject(IConfigurationService) private configService: IConfigurationService, - @inject(IFileSystemNode) private fileSystem: IFileSystemNode, + @inject(IFileSystem) private fileSystem: IFileSystem, @inject(IApplicationShell) private readonly applicationShell: IApplicationShell, @inject(IDataScienceErrorHandler) protected errorHandler: IDataScienceErrorHandler ) {} diff --git a/src/webviews/extension-side/serviceRegistry.node.ts b/src/webviews/extension-side/serviceRegistry.node.ts index 62503748549..79282ce2fd5 100644 --- a/src/webviews/extension-side/serviceRegistry.node.ts +++ b/src/webviews/extension-side/serviceRegistry.node.ts @@ -20,7 +20,7 @@ import { IJupyterVariableDataProviderFactory } from './dataviewer/types'; import { INotebookExporter, INotebookImporter } from '../../kernels/jupyter/types'; -import { JupyterExporter } from './import-export/jupyterExporter.node'; +import { JupyterExporter } from './import-export/jupyterExporter'; import { JupyterImporter } from './import-export/jupyterImporter.node'; import { CommandRegistry as ExportCommandRegistry } from './import-export/commandRegistry'; import { ServerPreload } from './serverPreload/serverPreload.node'; diff --git a/src/webviews/extension-side/serviceRegistry.web.ts b/src/webviews/extension-side/serviceRegistry.web.ts index 78725f390d3..0ad8a2f76bb 100644 --- a/src/webviews/extension-side/serviceRegistry.web.ts +++ b/src/webviews/extension-side/serviceRegistry.web.ts @@ -26,6 +26,8 @@ import { ExtensionSideRenderer, IExtensionSideRenderer } from './renderer'; import { ActiveEditorContextService } from './activeEditorContext'; import { GlobalActivation } from './globalActivation'; import { DataViewer } from './dataviewer/dataViewer'; +import { INotebookExporter } from '../../kernels/jupyter/types'; +import { JupyterExporter } from './import-export/jupyterExporter'; export function registerTypes(serviceManager: IServiceManager, _isDevMode: boolean) { serviceManager.addSingleton(IExtensionSingleActivationService, GlobalActivation); @@ -64,4 +66,5 @@ export function registerTypes(serviceManager: IServiceManager, _isDevMode: boole ); serviceManager.addSingletonInstance(IExtensionSideRenderer, new ExtensionSideRenderer()); + serviceManager.add(INotebookExporter, JupyterExporter); }