Skip to content

Commit

Permalink
Merge branch 'main' into tyriar/capture-group
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Nov 16, 2022
2 parents c6cbfcd + da681ee commit fb7c7e1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/extension.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if ((Reflect as any).metadata === undefined) {
}

// Initialize the logger first.
require('./platform/logging');
import './platform/logging';

//===============================================
// We start tracking the extension's startup time at this point. The
Expand Down
2 changes: 1 addition & 1 deletion src/extension.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if ((Reflect as any).metadata === undefined) {
require('setimmediate');

// Initialize the logger first.
require('./platform/logging');
import './platform/logging';

//===============================================
// We start tracking the extension's startup time at this point. The
Expand Down
28 changes: 22 additions & 6 deletions src/interactive-window/interactiveWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,16 @@ export class InteractiveWindow implements IInteractiveWindowLoadable {
return;
}
// Id may be different if the user switched controllers
this.currentKernelInfo.controller = this.controllerRegistration.registered.find(
(item) => item.id === k.controller.id
)!.controller;
traceInfoIfCI(
`Looking for controller ${k.controller.id} in ${this.controllerRegistration.all
.map((item) => `${item.kind}:${item.id}`)
.join(', ')}`
);
const found = this.controllerRegistration.registered.find((item) => item.id === k.controller.id);
if (!found) {
throw Error(`Controller ${k.controller.id} not found or not yet created`);
}
this.currentKernelInfo.controller = found.controller;
this.currentKernelInfo.metadata = k.kernelConnectionMetadata;
!!this.pendingCellAdd && this.setPendingCellAdd(this.pendingCellAdd);
this.updateSysInfoMessage(
Expand All @@ -303,9 +310,18 @@ export class InteractiveWindow implements IInteractiveWindowLoadable {
'jupyterExtension',
onStartKernel
);
this.currentKernelInfo.controller = this.controllerRegistration.registered.find(
(item) => item.id === kernel.controller.id
)!.controller;

traceInfoIfCI(
`Looking for controller ${kernel.controller.id} in ${this.controllerRegistration.all
.map((item) => `${item.kind}:${item.id}`)
.join(', ')}`
);
const found = this.controllerRegistration.registered.find((item) => item.id === kernel.controller.id);
if (!found) {
throw Error(`Controller ${kernel.controller.id} not found or not yet created`);
}

this.currentKernelInfo.controller = found.controller;
this.currentKernelInfo.metadata = kernel.kernelConnectionMetadata;

const kernelEventHookForRestart = async () => {
Expand Down
6 changes: 6 additions & 0 deletions src/test/datascience/interactiveDebugging.vscode.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Commands } from '../../platform/common/constants';
import { IVariableViewProvider } from '../../webviews/extension-side/variablesView/types';
import { pythonIWKernelDebugAdapter } from '../../notebooks/debugger/constants';
import { isWeb, noop } from '../../platform/common/utils/misc';
import { IControllerDefaultService } from '../../notebooks/controllers/types';

export type DebuggerType = 'VSCodePythonDebugger' | 'JupyterProtocolDebugger';

Expand Down Expand Up @@ -66,6 +67,11 @@ export function sharedIWDebuggerTests(
if (isWeb() || (IS_REMOTE_NATIVE_TEST() && debuggerType === 'VSCodePythonDebugger')) {
await startJupyterServer();
}
if (!isWeb() && !IS_REMOTE_NATIVE_TEST()) {
await api.serviceContainer
.get<IControllerDefaultService>(IControllerDefaultService)
.computeDefaultController(undefined, 'interactive');
}
await vscode.commands.executeCommand('workbench.debug.viewlet.action.removeAllBreakpoints');
disposables.push(vscode.debug.registerDebugAdapterTrackerFactory('python', tracker));
disposables.push(vscode.debug.registerDebugAdapterTrackerFactory(pythonIWKernelDebugAdapter, tracker));
Expand Down

0 comments on commit fb7c7e1

Please sign in to comment.