Skip to content

Commit

Permalink
Fix IW tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Sep 15, 2022
1 parent fb44466 commit 4666c1a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/interactive-window/interactiveWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ import { chainWithPendingUpdates } from '../kernels/execution/notebookUpdater';
import { initializeInteractiveOrNotebookTelemetryBasedOnUserAction } from '../kernels/telemetry/helper';
import { generateMarkdownFromCodeLines, parseForComments } from '../platform/common/utils';
import { IServiceContainer } from '../platform/ioc/types';
import { KernelConnector } from '../notebooks/controllers/kernelConnector';

/**
* ViewModel for an interactive window from the Jupyter extension's point of view.
Expand Down Expand Up @@ -255,6 +254,13 @@ export class InteractiveWindow implements IInteractiveWindowLoadable {
await this.currentKernelInfo.kernelStarted.promise;
return this.currentKernelInfo.kernel!;
}
const vscController = this.controllerRegistration.registered.find(
(item) => item.controller.id === controller.id
);
if (!vscController) {
// This cannot happen, but we need to make typescript happy.
throw new Error('VSCController not available');
}
const kernelStarted = createDeferred<void>();
kernelStarted.promise.catch(noop);
this.currentKernelInfo = { controller, metadata, kernelStarted };
Expand Down Expand Up @@ -287,13 +293,9 @@ export class InteractiveWindow implements IInteractiveWindowLoadable {
};
// When connecting, we need to update the sys info message
this.updateSysInfoMessage(this.getSysInfoMessage(metadata, SysInfoReason.Start), false, sysInfoCell);
const kernel = await KernelConnector.connectToNotebookKernel(
metadata,
this.serviceContainer,
{ resource: this.owner, notebook: this.notebookDocument, controller },
const kernel = await vscController.connectToKernel(
{ resource: this.owner, notebook: this.notebookDocument },
new DisplayOptions(false),
this.internalDisposables,
'jupyterExtension',
onKernelStarted,
onKernelStartCompleted
);
Expand Down

0 comments on commit 4666c1a

Please sign in to comment.