Skip to content

Commit 545c0a7

Browse files
authored
Remove controllers from ThirdParty Kernels (#10884)
* Separate kernel providers * Fix tests * Fix tests * Misc * Remote notebook * Misc fixes * Misc * Misc
1 parent 0b1ff9f commit 545c0a7

18 files changed

+505
-437
lines changed

src/interactive-window/interactiveWindow.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,9 @@ export class InteractiveWindow implements IInteractiveWindowLoadable {
257257
// When connecting, we need to update the sys info message
258258
this.updateSysInfoMessage(this.getSysInfoMessage(metadata, SysInfoReason.Start), false, sysInfoCell);
259259
const kernel = await KernelConnector.connectToNotebookKernel(
260-
controller,
261260
metadata,
262261
this.serviceContainer,
263-
{ resource: this.owner, notebook: this.notebookDocument },
262+
{ resource: this.owner, notebook: this.notebookDocument, controller },
264263
new DisplayOptions(false),
265264
this.internalDisposables,
266265
'jupyterExtension',

src/kernels/errors/kernelErrorHandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,15 @@ export abstract class DataScienceErrorHandler implements IDataScienceErrorHandle
279279
err instanceof InvalidRemoteJupyterServerUriHandleError
280280
? this.extensions.getExtension(err.extensionId)?.packageJSON.displayName || err.extensionId
281281
: '';
282+
const options = actionSource === 'jupyterExtension' ? [DataScience.selectDifferentKernel()] : [];
282283
const selection = await this.applicationShell.showErrorMessage(
283284
err instanceof InvalidRemoteJupyterServerUriHandleError
284285
? DataScience.remoteJupyterServerProvidedBy3rdPartyExtensionNoLongerValid().format(extensionName)
285286
: DataScience.remoteJupyterConnectionFailedWithServer().format(serverName),
286287
{ detail: message, modal: true },
287288
DataScience.removeRemoteJupyterConnectionButtonText(),
288289
DataScience.changeRemoteJupyterConnectionButtonText(),
289-
DataScience.selectDifferentKernel()
290+
...options
290291
);
291292
switch (selection) {
292293
case DataScience.removeRemoteJupyterConnectionButtonText(): {

src/kernels/execution/kernelExecution.ts

Lines changed: 172 additions & 127 deletions
Large diffs are not rendered by default.

src/kernels/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const NamedRegexp = require('named-js-regexp') as typeof import('named-js-regexp
66
import * as path from '../platform/vscode-path/path';
77
import * as uriPath from '../platform/vscode-path/resources';
88
import * as nbformat from '@jupyterlab/nbformat';
9-
import type { KernelSpec } from '@jupyterlab/services';
9+
import type { Kernel, KernelSpec } from '@jupyterlab/services';
1010
// eslint-disable-next-line @typescript-eslint/no-require-imports
1111
import cloneDeep = require('lodash/cloneDeep');
1212
import * as url from 'url-parse';
@@ -1452,7 +1452,7 @@ export type SilentExecutionErrorOptions = {
14521452
};
14531453

14541454
export async function executeSilently(
1455-
session: IKernelConnectionSession,
1455+
session: IKernelConnectionSession | Kernel.IKernelConnection,
14561456
code: string,
14571457
errorOptions?: SilentExecutionErrorOptions
14581458
): Promise<nbformat.IOutput[]> {

0 commit comments

Comments
 (0)