Skip to content

Commit

Permalink
temp fix for run by line after interrupting (#7311)
Browse files Browse the repository at this point in the history
* fix 7251

* change comments

* use constant instead of emtpy string
  • Loading branch information
David Kutugata authored Aug 26, 2021
1 parent f24a7a0 commit c2b6335
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/client/debugger/jupyter/kernelDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { traceError, traceVerbose } from '../../common/logger';
import { IFileSystem } from '../../common/platform/types';
import { IKernelDebugAdapter } from '../types';
import { IDisposable } from '../../common/types';
import { Commands } from '../../datascience/constants';
import { Commands, Identifiers } from '../../datascience/constants';
import { IKernel } from '../../datascience/jupyter/kernels/types';
import { sendTelemetryEvent } from '../../telemetry';
import { DebuggingTelemetry } from '../constants';
Expand Down Expand Up @@ -470,6 +470,13 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID
}

private async initializeExecute(seq: number) {
// remove this if when https://github.com/microsoft/debugpy/issues/706 is fixed and ipykernel ships it
// executing this code restarts debugpy and fixes https://github.com/microsoft/vscode-jupyter/issues/7251
if (this.kernel) {
const code = 'import debugpy\ndebugpy.debug_this_thread()';
await this.kernel.executeHidden(code, Identifiers.EmptyFileName, this.notebookDocument);
}

// put breakpoint at the beginning of the cell
const cellIndex = Number(this.configuration.__cellIndex);
const cell = this.notebookDocument.cellAt(cellIndex);
Expand Down

0 comments on commit c2b6335

Please sign in to comment.