Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix restart when the notebook editor is not active. #11828

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/notebooks/debugger/controllers/restartController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class RestartController implements IDebuggingDelegate {
.disconnect()
.then(() => {
this.trace('restart', 'doRestart');
return this.debuggingManager.tryToStartDebugging(this.mode, this.debugCell);
return this.debuggingManager.tryToStartDebugging(this.mode, this.debugCell, true);
})
.catch((err) => {
this.error('restart', `Error restarting: ${err}`);
Expand Down
15 changes: 10 additions & 5 deletions src/notebooks/debugger/debuggingManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,20 @@ export class DebuggingManager
this.debugDocuments.set(Array.from(debugDocumentUris.values())).ignoreErrors();
}

public async tryToStartDebugging(mode: KernelDebugMode, cell: NotebookCell) {
public async tryToStartDebugging(mode: KernelDebugMode, cell: NotebookCell, skipIpykernelCheck = false) {
traceInfo(`Starting debugging with mode ${mode}`);

const ipykernelResult = await this.checkIpykernelAndPrompt(cell);
if (ipykernelResult === IpykernelCheckResult.Ok) {
if (mode === KernelDebugMode.RunByLine || mode === KernelDebugMode.Cell) {
await this.startDebuggingCell(mode, cell!);
if (!skipIpykernelCheck) {
const ipykernelResult = await this.checkIpykernelAndPrompt(cell);
if (ipykernelResult !== IpykernelCheckResult.Ok) {
traceInfo(`Ipykernel check failed: ${IpykernelCheckResult[ipykernelResult]}`);
return;
}
}

if (mode === KernelDebugMode.RunByLine || mode === KernelDebugMode.Cell) {
await this.startDebuggingCell(mode, cell!);
}
}

public runByLineNext(cell: NotebookCell) {
Expand Down
2 changes: 1 addition & 1 deletion src/notebooks/debugger/debuggingTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export interface IDebuggingManager {

export const INotebookDebuggingManager = Symbol('INotebookDebuggingManager');
export interface INotebookDebuggingManager extends IDebuggingManager {
tryToStartDebugging(mode: KernelDebugMode, cell: NotebookCell): Promise<void>;
tryToStartDebugging(mode: KernelDebugMode, cell: NotebookCell, skipIpykernelCheck?: boolean): Promise<void>;
runByLineNext(cell: NotebookCell): void;
runByLineStop(cell: NotebookCell): void;
}
Expand Down