Skip to content

Commit

Permalink
use full cell
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kutugata committed Sep 24, 2021
1 parent 3efb089 commit 7239e16
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/client/debugger/jupyter/kernelDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
NotebookCellKind,
NotebookCellsChangeEvent,
NotebookDocument,
notebooks,
Uri
notebooks
} from 'vscode';
import { DebugProtocol } from 'vscode-debugprotocol';
import { traceError, traceVerbose } from '../../common/logger';
Expand Down Expand Up @@ -52,7 +51,7 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID
private delegate: IDebuggingDelegate | undefined;
onDidSendMessage: Event<DebugProtocolMessage> = this.sendMessage.event;
onDidEndSession: Event<DebugSession> = this.endSession.event;
public readonly debugCellUri: Uri | undefined;
public readonly debugCell: NotebookCell | undefined;
private disconected: boolean = false;

constructor(
Expand All @@ -67,7 +66,7 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID
this.configuration = configuration;

if (configuration.__mode === KernelDebugMode.Cell || configuration.__mode === KernelDebugMode.RunByLine) {
this.debugCellUri = notebookDocument.cellAt(configuration.__cellIndex!)?.document.uri;
this.debugCell = notebookDocument.cellAt(configuration.__cellIndex!);
}

this.disposables.push(
Expand Down Expand Up @@ -129,7 +128,7 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID
(e: NotebookCellsChangeEvent) => {
e.changes.forEach((change) => {
change.deletedItems.forEach((cell: NotebookCell) => {
if (cell.document.uri === this.debugCellUri) {
if (cell === this.debugCell) {
this.disconnect();
}
});
Expand Down

0 comments on commit 7239e16

Please sign in to comment.