Skip to content

Commit

Permalink
Remove controllers from ThirdParty Kernels (#10884)
Browse files Browse the repository at this point in the history
* Separate kernel providers

* Fix tests

* Fix tests

* Misc

* Remote notebook

* Misc fixes

* Misc

* Misc
  • Loading branch information
DonJayamanne authored Jul 21, 2022
1 parent 0b1ff9f commit 545c0a7
Show file tree
Hide file tree
Showing 18 changed files with 505 additions and 437 deletions.
3 changes: 1 addition & 2 deletions src/interactive-window/interactiveWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,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(
controller,
metadata,
this.serviceContainer,
{ resource: this.owner, notebook: this.notebookDocument },
{ resource: this.owner, notebook: this.notebookDocument, controller },
new DisplayOptions(false),
this.internalDisposables,
'jupyterExtension',
Expand Down
3 changes: 2 additions & 1 deletion src/kernels/errors/kernelErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,15 @@ export abstract class DataScienceErrorHandler implements IDataScienceErrorHandle
err instanceof InvalidRemoteJupyterServerUriHandleError
? this.extensions.getExtension(err.extensionId)?.packageJSON.displayName || err.extensionId
: '';
const options = actionSource === 'jupyterExtension' ? [DataScience.selectDifferentKernel()] : [];
const selection = await this.applicationShell.showErrorMessage(
err instanceof InvalidRemoteJupyterServerUriHandleError
? DataScience.remoteJupyterServerProvidedBy3rdPartyExtensionNoLongerValid().format(extensionName)
: DataScience.remoteJupyterConnectionFailedWithServer().format(serverName),
{ detail: message, modal: true },
DataScience.removeRemoteJupyterConnectionButtonText(),
DataScience.changeRemoteJupyterConnectionButtonText(),
DataScience.selectDifferentKernel()
...options
);
switch (selection) {
case DataScience.removeRemoteJupyterConnectionButtonText(): {
Expand Down
299 changes: 172 additions & 127 deletions src/kernels/execution/kernelExecution.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/kernels/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const NamedRegexp = require('named-js-regexp') as typeof import('named-js-regexp
import * as path from '../platform/vscode-path/path';
import * as uriPath from '../platform/vscode-path/resources';
import * as nbformat from '@jupyterlab/nbformat';
import type { KernelSpec } from '@jupyterlab/services';
import type { Kernel, KernelSpec } from '@jupyterlab/services';
// eslint-disable-next-line @typescript-eslint/no-require-imports
import cloneDeep = require('lodash/cloneDeep');
import * as url from 'url-parse';
Expand Down Expand Up @@ -1452,7 +1452,7 @@ export type SilentExecutionErrorOptions = {
};

export async function executeSilently(
session: IKernelConnectionSession,
session: IKernelConnectionSession | Kernel.IKernelConnection,
code: string,
errorOptions?: SilentExecutionErrorOptions
): Promise<nbformat.IOutput[]> {
Expand Down
Loading

0 comments on commit 545c0a7

Please sign in to comment.