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

Remove controllers from ThirdParty Kernels #10884

Merged
merged 8 commits into from
Jul 21, 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
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