From 1546b779e62e1f88eef23b25ee88edf1b909e7b5 Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Wed, 11 May 2022 11:30:18 -0700 Subject: [PATCH 1/9] fix wrong type ref --- src/kernels/debugging/jupyterDebugService.node.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/kernels/debugging/jupyterDebugService.node.ts b/src/kernels/debugging/jupyterDebugService.node.ts index 01a04676b50..0906a8337bc 100644 --- a/src/kernels/debugging/jupyterDebugService.node.ts +++ b/src/kernels/debugging/jupyterDebugService.node.ts @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { IDisposable } from '@fluentui/react'; import { inject, injectable } from 'inversify'; import * as net from 'net'; import * as path from '../../platform/vscode-path/path'; @@ -24,7 +23,7 @@ import { } from 'vscode'; import { DebugProtocol } from 'vscode-debugprotocol'; import { traceInfo, traceError } from '../../platform/logging'; -import { IDisposableRegistry } from '../../platform/common/types'; +import { IDisposable, IDisposableRegistry } from '../../platform/common/types'; import { createDeferred } from '../../platform/common/utils/async'; import { noop } from '../../platform/common/utils/misc'; import { EXTENSION_ROOT_DIR } from '../../platform/constants.node'; From 24b4d043ca13310c2850ae6910036ac86070127e Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Wed, 11 May 2022 12:10:28 -0700 Subject: [PATCH 2/9] convert helpers and debug controllers to non node files --- .../{debugControllers.node.ts => debugControllers.ts} | 2 +- src/platform/debugger/jupyter/debuggingManager.node.ts | 4 ++-- .../debugger/jupyter/{helper.node.ts => helper.ts} | 0 src/platform/debugger/jupyter/kernelDebugAdapter.node.ts | 7 +------ src/test/debugger/jupyter/helpers.unit.test.ts | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) rename src/platform/debugger/jupyter/{debugControllers.node.ts => debugControllers.ts} (99%) rename src/platform/debugger/jupyter/{helper.node.ts => helper.ts} (100%) diff --git a/src/platform/debugger/jupyter/debugControllers.node.ts b/src/platform/debugger/jupyter/debugControllers.ts similarity index 99% rename from src/platform/debugger/jupyter/debugControllers.node.ts rename to src/platform/debugger/jupyter/debugControllers.ts index 2e289508ada..e8359d3e6d0 100644 --- a/src/platform/debugger/jupyter/debugControllers.node.ts +++ b/src/platform/debugger/jupyter/debugControllers.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import * as path from '../../../platform/vscode-path/path'; +import * as path from '../../vscode-path/path'; import { DebugProtocolMessage, NotebookCell } from 'vscode'; import { DebugProtocol } from 'vscode-debugprotocol'; import { parseForComments } from '../../../webviews/webview-side/common'; diff --git a/src/platform/debugger/jupyter/debuggingManager.node.ts b/src/platform/debugger/jupyter/debuggingManager.node.ts index e0db242b3cc..94a65823653 100644 --- a/src/platform/debugger/jupyter/debuggingManager.node.ts +++ b/src/platform/debugger/jupyter/debuggingManager.node.ts @@ -31,8 +31,8 @@ import { IPlatformService } from '../../common/platform/types'; import { IDebuggingManager, IKernelDebugAdapterConfig, KernelDebugMode } from '../types'; import { DebuggingTelemetry, pythonKernelDebugAdapter } from '../constants'; import { sendTelemetryEvent } from '../../../telemetry'; -import { DebugCellController, RunByLineController } from './debugControllers.node'; -import { assertIsDebugConfig, IpykernelCheckResult, isUsingIpykernel6OrLater } from './helper.node'; +import { DebugCellController, RunByLineController } from './debugControllers'; +import { assertIsDebugConfig, IpykernelCheckResult, isUsingIpykernel6OrLater } from './helper'; import { Debugger } from './debugger.node'; import { INotebookControllerManager } from '../../../notebooks/types'; import { IFileSystem } from '../../common/platform/types.node'; diff --git a/src/platform/debugger/jupyter/helper.node.ts b/src/platform/debugger/jupyter/helper.ts similarity index 100% rename from src/platform/debugger/jupyter/helper.node.ts rename to src/platform/debugger/jupyter/helper.ts diff --git a/src/platform/debugger/jupyter/kernelDebugAdapter.node.ts b/src/platform/debugger/jupyter/kernelDebugAdapter.node.ts index 343b4897bdb..e5c0a1f4a77 100644 --- a/src/platform/debugger/jupyter/kernelDebugAdapter.node.ts +++ b/src/platform/debugger/jupyter/kernelDebugAdapter.node.ts @@ -35,12 +35,7 @@ import { IKernelDebugAdapterConfig, KernelDebugMode } from '../types'; -import { - assertIsDebugConfig, - getMessageSourceAndHookIt, - isShortNamePath, - shortNameMatchesLongName -} from './helper.node'; +import { assertIsDebugConfig, getMessageSourceAndHookIt, isShortNamePath, shortNameMatchesLongName } from './helper'; import { IFileSystem } from '../../common/platform/types.node'; // For info on the custom requests implemented by jupyter see: diff --git a/src/test/debugger/jupyter/helpers.unit.test.ts b/src/test/debugger/jupyter/helpers.unit.test.ts index b6148efed5c..09eb3b622f5 100644 --- a/src/test/debugger/jupyter/helpers.unit.test.ts +++ b/src/test/debugger/jupyter/helpers.unit.test.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { expect } from 'chai'; -import { isShortNamePath } from '../../../platform/debugger/jupyter/helper.node'; +import { isShortNamePath } from '../../../platform/debugger/jupyter/helper'; suite('Debugging - Helpers', () => { suite('isShortNamePath', async () => { From 56e97dcb3df8cc5e5690d378d71d15091d515cbb Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Wed, 11 May 2022 13:29:48 -0700 Subject: [PATCH 3/9] more node renames around debuggingManager, also commented out FileSystem usage in kernelDebugAdapter --- .../jupyter/{debugger.node.ts => debugger.ts} | 0 .../debugger/jupyter/debuggingManager.node.ts | 11 ++++++----- ...elDebugAdapter.node.ts => kernelDebugAdapter.ts} | 13 +++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) rename src/platform/debugger/jupyter/{debugger.node.ts => debugger.ts} (100%) rename src/platform/debugger/jupyter/{kernelDebugAdapter.node.ts => kernelDebugAdapter.ts} (97%) diff --git a/src/platform/debugger/jupyter/debugger.node.ts b/src/platform/debugger/jupyter/debugger.ts similarity index 100% rename from src/platform/debugger/jupyter/debugger.node.ts rename to src/platform/debugger/jupyter/debugger.ts diff --git a/src/platform/debugger/jupyter/debuggingManager.node.ts b/src/platform/debugger/jupyter/debuggingManager.node.ts index 94a65823653..b7bed672484 100644 --- a/src/platform/debugger/jupyter/debuggingManager.node.ts +++ b/src/platform/debugger/jupyter/debuggingManager.node.ts @@ -20,7 +20,7 @@ import { import * as path from '../../../platform/vscode-path/path'; import { IKernel, IKernelProvider } from '../../../kernels/types'; import { IConfigurationService, IDisposable } from '../../common/types'; -import { KernelDebugAdapter } from './kernelDebugAdapter.node'; +import { KernelDebugAdapter } from './kernelDebugAdapter'; import { IExtensionSingleActivationService } from '../../activation/types'; import { ContextKey } from '../../common/contextKey'; import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../common/application/types'; @@ -33,9 +33,9 @@ import { DebuggingTelemetry, pythonKernelDebugAdapter } from '../constants'; import { sendTelemetryEvent } from '../../../telemetry'; import { DebugCellController, RunByLineController } from './debugControllers'; import { assertIsDebugConfig, IpykernelCheckResult, isUsingIpykernel6OrLater } from './helper'; -import { Debugger } from './debugger.node'; +import { Debugger } from './debugger'; import { INotebookControllerManager } from '../../../notebooks/types'; -import { IFileSystem } from '../../common/platform/types.node'; +//import { IFileSystem } from '../../common/platform/types.node'; /** * The DebuggingManager maintains the mapping between notebook documents and debug sessions. @@ -57,7 +57,7 @@ export class DebuggingManager implements IExtensionSingleActivationService, IDeb @inject(ICommandManager) private readonly commandManager: ICommandManager, @inject(IApplicationShell) private readonly appShell: IApplicationShell, @inject(IVSCodeNotebook) private readonly vscNotebook: IVSCodeNotebook, - @inject(IFileSystem) private fs: IFileSystem, + //@inject(IFileSystem) private fs: IFileSystem, @inject(IConfigurationService) private settings: IConfigurationService, @inject(IPlatformService) private platform: IPlatformService ) { @@ -380,7 +380,8 @@ export class DebuggingManager implements IExtensionSingleActivationService, IDeb session, debug.document, kernel.session, - this.fs, + // IANHU TOOD: Need to resolve + //this.fs, kernel, this.platform ); diff --git a/src/platform/debugger/jupyter/kernelDebugAdapter.node.ts b/src/platform/debugger/jupyter/kernelDebugAdapter.ts similarity index 97% rename from src/platform/debugger/jupyter/kernelDebugAdapter.node.ts rename to src/platform/debugger/jupyter/kernelDebugAdapter.ts index e5c0a1f4a77..18a229e9b28 100644 --- a/src/platform/debugger/jupyter/kernelDebugAdapter.node.ts +++ b/src/platform/debugger/jupyter/kernelDebugAdapter.ts @@ -4,7 +4,7 @@ 'use strict'; import { KernelMessage } from '@jupyterlab/services'; -import * as path from '../../../platform/vscode-path/path'; +import * as path from '../../vscode-path/path'; import { debug, DebugAdapter, @@ -36,7 +36,7 @@ import { KernelDebugMode } from '../types'; import { assertIsDebugConfig, getMessageSourceAndHookIt, isShortNamePath, shortNameMatchesLongName } from './helper'; -import { IFileSystem } from '../../common/platform/types.node'; +// import { IFileSystem } from '../../common/platform/types.node'; // For info on the custom requests implemented by jupyter see: // https://jupyter-client.readthedocs.io/en/stable/messaging.html#debug-request @@ -59,7 +59,7 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID private session: DebugSession, private notebookDocument: NotebookDocument, private readonly jupyterSession: IJupyterSession, - private fs: IFileSystem, + // private fs: IFileSystem, private readonly kernel: IKernel | undefined, private readonly platformService: IPlatformService ) { @@ -192,10 +192,11 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID dispose() { this.disposables.forEach((d) => d.dispose()); // clean temp files - this.cellToFile.forEach((tempPath) => { - const norm = path.normalize(tempPath); + this.cellToFile.forEach((_tempPath) => { + // const norm = path.normalize(tempPath); try { - void this.fs.deleteLocalFile(norm); + // IANHU TODO: Need to handle this file delete in web case + //void this.fs.deleteLocalFile(norm); } catch { traceError('Error deleting temporary debug files'); } From d50d450e2703a18f1d79e0f3011b6a968e46eeba Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Wed, 11 May 2022 13:32:29 -0700 Subject: [PATCH 4/9] rename debugging manager and add to web service registry --- .../{debuggingManager.node.ts => debuggingManager.ts} | 2 +- src/platform/serviceRegistry.node.ts | 2 +- src/platform/serviceRegistry.web.ts | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) rename src/platform/debugger/jupyter/{debuggingManager.node.ts => debuggingManager.ts} (99%) diff --git a/src/platform/debugger/jupyter/debuggingManager.node.ts b/src/platform/debugger/jupyter/debuggingManager.ts similarity index 99% rename from src/platform/debugger/jupyter/debuggingManager.node.ts rename to src/platform/debugger/jupyter/debuggingManager.ts index b7bed672484..36703bab418 100644 --- a/src/platform/debugger/jupyter/debuggingManager.node.ts +++ b/src/platform/debugger/jupyter/debuggingManager.ts @@ -17,7 +17,7 @@ import { EventEmitter, NotebookEditor } from 'vscode'; -import * as path from '../../../platform/vscode-path/path'; +import * as path from '../../vscode-path/path'; import { IKernel, IKernelProvider } from '../../../kernels/types'; import { IConfigurationService, IDisposable } from '../../common/types'; import { KernelDebugAdapter } from './kernelDebugAdapter'; diff --git a/src/platform/serviceRegistry.node.ts b/src/platform/serviceRegistry.node.ts index a186e421a3d..cb19064cf0a 100644 --- a/src/platform/serviceRegistry.node.ts +++ b/src/platform/serviceRegistry.node.ts @@ -33,7 +33,7 @@ import { GlobalActivation } from './common/globalActivation'; import { PreReleaseChecker } from './common/prereleaseChecker.node'; import { IConfigurationService, IDataScienceCommandListener, IExtensionContext } from './common/types'; import { DebugLocationTrackerFactory } from './debugger/debugLocationTrackerFactory.node'; -import { DebuggingManager } from './debugger/jupyter/debuggingManager.node'; +import { DebuggingManager } from './debugger/jupyter/debuggingManager'; import { IDebugLocationTracker, IDebuggingManager } from './debugger/types'; import { DataScienceErrorHandler } from './errors/errorHandler'; import { IDataScienceErrorHandler } from './errors/types'; diff --git a/src/platform/serviceRegistry.web.ts b/src/platform/serviceRegistry.web.ts index ea706ca6c6c..1d76b9b59f4 100644 --- a/src/platform/serviceRegistry.web.ts +++ b/src/platform/serviceRegistry.web.ts @@ -27,6 +27,8 @@ import { GlobalActivation } from './common/globalActivation'; import { IExtensionSingleActivationService } from './activation/types'; import { ExtensionSideRenderer, IExtensionSideRenderer } from '../webviews/extension-side/renderer'; import { OutputCommandListener } from './logging/outputCommandListener'; +import { IDebuggingManager } from './debugger/types'; +import { DebuggingManager } from './debugger/jupyter/debuggingManager'; export function registerTypes(context: IExtensionContext, serviceManager: IServiceManager, isDevMode: boolean) { serviceManager.addSingleton(ICommandManager, CommandManager); @@ -44,4 +46,8 @@ export function registerTypes(context: IExtensionContext, serviceManager: IServi registerApiTypes(serviceManager); registerActivationTypes(serviceManager); registerDevToolTypes(context, serviceManager, isDevMode); + + serviceManager.addSingleton(IDebuggingManager, DebuggingManager, undefined, [ + IExtensionSingleActivationService + ]); } From 2400c9be26320a52d039138411ca998a10fb7081 Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Wed, 11 May 2022 15:14:15 -0700 Subject: [PATCH 5/9] package.json changes for debug commands in web extension --- package.json | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 64f8b72aa87..aacb4a74736 100644 --- a/package.json +++ b/package.json @@ -291,7 +291,7 @@ "title": "%jupyter.command.jupyter.debug.title%", "icon": "$(bug)", "category": "Jupyter", - "enablement": "notebookKernelCount > 0 && !jupyter.notebookeditor.debuggingInProgress && !jupyter.notebookeditor.runByLineInProgress && !jupyter.webExtension" + "enablement": "notebookKernelCount > 0 && !jupyter.notebookeditor.debuggingInProgress && !jupyter.notebookeditor.runByLineInProgress" }, { "command": "jupyter.filterKernels", @@ -304,28 +304,27 @@ "title": "%jupyter.command.jupyter.runByLine.title%", "icon": "$(debug-line-by-line)", "category": "Jupyter", - "enablement": "notebookKernelCount > 0 && !jupyter.notebookeditor.debuggingInProgress && !jupyter.notebookeditor.runByLineInProgress && !jupyter.webExtension" + "enablement": "notebookKernelCount > 0 && !jupyter.notebookeditor.debuggingInProgress && !jupyter.notebookeditor.runByLineInProgress" }, { "command": "jupyter.runAndDebugCell", "title": "%jupyter.command.jupyter.debugCell.title%", "icon": "$(debug-alt-small)", - "category": "Jupyter", - "enablement": "!jupyter.webExtension" + "category": "Jupyter" }, { "command": "jupyter.runByLineNext", "title": "%jupyter.command.jupyter.runByLineNext.title%", "icon": "$(debug-line-by-line)", "category": "Jupyter", - "enablement": "jupyter.notebookeditor.runByLineInProgress && !jupyter.webExtension" + "enablement": "jupyter.notebookeditor.runByLineInProgress" }, { "command": "jupyter.runByLineStop", "title": "%jupyter.command.jupyter.runByLineStop.title%", "icon": "$(debug-continue-small)", "category": "Jupyter", - "enablement": "notebookKernelCount > 0 && jupyter.notebookeditor.runByLineInProgress && !jupyter.webExtension" + "enablement": "notebookKernelCount > 0 && jupyter.notebookeditor.runByLineInProgress" }, { "command": "jupyter.viewOutput", @@ -383,25 +382,25 @@ "command": "jupyter.debugcell", "title": "%jupyter.command.jupyter.debugcell.title%", "category": "Jupyter", - "enablement": "isWorkspaceTrusted && !jupyter.webExtension" + "enablement": "isWorkspaceTrusted" }, { "command": "jupyter.debugstepover", "title": "%jupyter.command.jupyter.debugstepover.title%", "category": "Jupyter", - "enablement": "isWorkspaceTrusted && !jupyter.webExtension" + "enablement": "isWorkspaceTrusted" }, { "command": "jupyter.debugstop", "title": "%jupyter.command.jupyter.debugstop.title%", "category": "Jupyter", - "enablement": "isWorkspaceTrusted && !jupyter.webExtension" + "enablement": "isWorkspaceTrusted" }, { "command": "jupyter.debugcontinue", "title": "%jupyter.command.jupyter.debugcontinue.title%", "category": "Jupyter", - "enablement": "isWorkspaceTrusted && !jupyter.webExtension" + "enablement": "isWorkspaceTrusted" }, { "command": "jupyter.insertCellBelowPosition", From 74bdd76020eb922b81af9c3cd567e32ffd6a415f Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Fri, 13 May 2022 12:06:00 -0700 Subject: [PATCH 6/9] This works, but needs clean up for how we run and delete cells --- .../debugger/jupyter/kernelDebugAdapter.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/platform/debugger/jupyter/kernelDebugAdapter.ts b/src/platform/debugger/jupyter/kernelDebugAdapter.ts index 18a229e9b28..1330c3d6242 100644 --- a/src/platform/debugger/jupyter/kernelDebugAdapter.ts +++ b/src/platform/debugger/jupyter/kernelDebugAdapter.ts @@ -183,6 +183,7 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID } public async disconnect() { + await this.deleteDumpCells(); await this.session.customRequest('disconnect', { restart: false }); this.endSession.fire(this.session); this.disconected = true; @@ -271,6 +272,21 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID return undefined; } + // Use our jupyter session to delete all the cells + private async deleteDumpCells() { + if (this.jupyterSession) { + this.cellToFile.forEach((tempFile) => { + const deleteSnippit = `import os +try: + os.remove("${tempFile}") +except: + pass`; + + this.jupyterSession.requestExecute({ code: deleteSnippit, silent: true, store_history: false }); + }); + } + } + private async sendRequestToJupyterSession(message: DebugProtocol.ProtocolMessage) { if (this.jupyterSession.disposed || this.jupyterSession.status === 'dead') { traceInfo(`Skipping sending message ${message.type} because session is disposed`); From 054fba4a3cced0077b3560c788caddae2c4b5d4e Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Fri, 13 May 2022 13:55:27 -0700 Subject: [PATCH 7/9] cleaned up a bit more --- .../debugger/jupyter/kernelDebugAdapter.ts | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/platform/debugger/jupyter/kernelDebugAdapter.ts b/src/platform/debugger/jupyter/kernelDebugAdapter.ts index 1330c3d6242..0517ba57c71 100644 --- a/src/platform/debugger/jupyter/kernelDebugAdapter.ts +++ b/src/platform/debugger/jupyter/kernelDebugAdapter.ts @@ -36,6 +36,7 @@ import { KernelDebugMode } from '../types'; import { assertIsDebugConfig, getMessageSourceAndHookIt, isShortNamePath, shortNameMatchesLongName } from './helper'; +import { executeSilently } from '../../../kernels/helpers'; // import { IFileSystem } from '../../common/platform/types.node'; // For info on the custom requests implemented by jupyter see: @@ -183,7 +184,6 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID } public async disconnect() { - await this.deleteDumpCells(); await this.session.customRequest('disconnect', { restart: false }); this.endSession.fire(this.session); this.disconected = true; @@ -191,17 +191,10 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID } dispose() { - this.disposables.forEach((d) => d.dispose()); - // clean temp files - this.cellToFile.forEach((_tempPath) => { - // const norm = path.normalize(tempPath); - try { - // IANHU TODO: Need to handle this file delete in web case - //void this.fs.deleteLocalFile(norm); - } catch { - traceError('Error deleting temporary debug files'); - } + this.deleteDumpCells().catch(() => { + traceError('Error deleting temporary debug files.'); }); + this.disposables.forEach((d) => d.dispose()); } public stackTrace(args: DebugProtocol.StackTraceArguments): Thenable { @@ -274,15 +267,29 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID // Use our jupyter session to delete all the cells private async deleteDumpCells() { - if (this.jupyterSession) { - this.cellToFile.forEach((tempFile) => { - const deleteSnippit = `import os -try: - os.remove("${tempFile}") -except: - pass`; - - this.jupyterSession.requestExecute({ code: deleteSnippit, silent: true, store_history: false }); + const fileValues = [...this.cellToFile.values()]; + // Need to have our Jupyter Session and some dumpCell files to delete + if (this.jupyterSession && fileValues.length) { + // Create our python string of file names + const fileListString = fileValues + .map((filePath) => { + return '"' + filePath + '"'; + }) + .join(','); + + // Insert into our delete snippet + const deleteFilesCode = `import os +_VSCODE_fileList = [${fileListString}] +for file in _VSCODE_fileList: + try: + os.remove(file) + except: + pass +del _VSCODE_fileList`; + + return executeSilently(this.jupyterSession, deleteFilesCode, { + traceErrors: true, + traceErrorsMessage: 'Error deleting temporary debugging files' }); } } From dd06f9cfedd976a7b89420b5459b9c8cba602243 Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Fri, 13 May 2022 16:38:57 -0700 Subject: [PATCH 8/9] add news --- news/2 Fixes/9973.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2 Fixes/9973.md diff --git a/news/2 Fixes/9973.md b/news/2 Fixes/9973.md new file mode 100644 index 00000000000..edffc7aa7c0 --- /dev/null +++ b/news/2 Fixes/9973.md @@ -0,0 +1 @@ +Support notebook debugging in the web extension. \ No newline at end of file From 0f5a003b4e6255511086a625a29a2ea44daff3ff Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Mon, 16 May 2022 09:11:41 -0700 Subject: [PATCH 9/9] remove some old comments --- src/platform/debugger/jupyter/debuggingManager.ts | 4 ---- src/platform/debugger/jupyter/kernelDebugAdapter.ts | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/platform/debugger/jupyter/debuggingManager.ts b/src/platform/debugger/jupyter/debuggingManager.ts index 36703bab418..6886133b176 100644 --- a/src/platform/debugger/jupyter/debuggingManager.ts +++ b/src/platform/debugger/jupyter/debuggingManager.ts @@ -35,7 +35,6 @@ import { DebugCellController, RunByLineController } from './debugControllers'; import { assertIsDebugConfig, IpykernelCheckResult, isUsingIpykernel6OrLater } from './helper'; import { Debugger } from './debugger'; import { INotebookControllerManager } from '../../../notebooks/types'; -//import { IFileSystem } from '../../common/platform/types.node'; /** * The DebuggingManager maintains the mapping between notebook documents and debug sessions. @@ -57,7 +56,6 @@ export class DebuggingManager implements IExtensionSingleActivationService, IDeb @inject(ICommandManager) private readonly commandManager: ICommandManager, @inject(IApplicationShell) private readonly appShell: IApplicationShell, @inject(IVSCodeNotebook) private readonly vscNotebook: IVSCodeNotebook, - //@inject(IFileSystem) private fs: IFileSystem, @inject(IConfigurationService) private settings: IConfigurationService, @inject(IPlatformService) private platform: IPlatformService ) { @@ -380,8 +378,6 @@ export class DebuggingManager implements IExtensionSingleActivationService, IDeb session, debug.document, kernel.session, - // IANHU TOOD: Need to resolve - //this.fs, kernel, this.platform ); diff --git a/src/platform/debugger/jupyter/kernelDebugAdapter.ts b/src/platform/debugger/jupyter/kernelDebugAdapter.ts index 0517ba57c71..34f36137dae 100644 --- a/src/platform/debugger/jupyter/kernelDebugAdapter.ts +++ b/src/platform/debugger/jupyter/kernelDebugAdapter.ts @@ -37,7 +37,6 @@ import { } from '../types'; import { assertIsDebugConfig, getMessageSourceAndHookIt, isShortNamePath, shortNameMatchesLongName } from './helper'; import { executeSilently } from '../../../kernels/helpers'; -// import { IFileSystem } from '../../common/platform/types.node'; // For info on the custom requests implemented by jupyter see: // https://jupyter-client.readthedocs.io/en/stable/messaging.html#debug-request @@ -60,7 +59,6 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID private session: DebugSession, private notebookDocument: NotebookDocument, private readonly jupyterSession: IJupyterSession, - // private fs: IFileSystem, private readonly kernel: IKernel | undefined, private readonly platformService: IPlatformService ) { @@ -191,6 +189,7 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID } dispose() { + // On dispose, delete our temp cell files this.deleteDumpCells().catch(() => { traceError('Error deleting temporary debug files.'); });