-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Kernel selection UI #8866
Kernel selection UI #8866
Changes from 1 commit
55bf0f4
3ef83f8
5e22dc5
a89eb8d
6293ef1
5a4a6aa
7aee062
bc0d9f7
5cc2346
ee1169a
a86da06
2f1238b
02cbba0
0b5dac3
e25eb72
22efccd
bbbae0a
23accfc
5f0bb15
25e2d19
2f758f4
f2caf13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ import { | |
import { JupyterInstallError } from '../jupyter/jupyterInstallError'; | ||
import { JupyterSelfCertsError } from '../jupyter/jupyterSelfCertsError'; | ||
import { JupyterKernelPromiseFailedError } from '../jupyter/kernels/jupyterKernelPromiseFailedError'; | ||
import { KernelSpecInterpreter } from '../jupyter/kernels/kernelSelector'; | ||
import { CssMessages } from '../messages'; | ||
import { | ||
CellState, | ||
|
@@ -1303,14 +1304,35 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp | |
private async selectKernel() { | ||
const settings = this.configuration.getSettings(); | ||
|
||
let kernel: KernelSpecInterpreter | undefined; | ||
|
||
if (settings.datascience.jupyterServerURI.toLowerCase() === Settings.JupyterServerLocalLaunch) { | ||
return this.dataScience.selectLocalJupyterKernel(); | ||
kernel = await this.dataScience.selectLocalJupyterKernel(); | ||
} else if (this.notebook) { | ||
const connInfo = this.notebook.server.getConnectionInfo(); | ||
|
||
if (connInfo) { | ||
await this.dataScience.selectRemoteJupyterKernel(connInfo); | ||
kernel = await this.dataScience.selectRemoteJupyterKernel(connInfo); | ||
} | ||
} | ||
|
||
if (kernel && kernel.kernelSpec && this.notebook) { | ||
let name = kernel.kernelSpec?.display_name; | ||
if (!name) { | ||
name = kernel.interpreter?.displayName ? kernel.interpreter.displayName : ''; | ||
} | ||
this.postMessage(InteractiveWindowMessages.UpdateKernel, { | ||
jupyterServerStatus: ServerStatus.Starting, | ||
localizedUri: settings.datascience.jupyterServerURI.toLowerCase() === Settings.JupyterServerLocalLaunch ? | ||
localize.DataScience.localJupyterServer() : settings.datascience.jupyterServerURI, | ||
displayName: name | ||
}).ignoreErrors(); | ||
|
||
// Also actually tell the kernel. | ||
await this.notebook.setKernelSpec(kernel.kernelSpec); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should't this be done first, before we update the UI? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that's probably better. Let me try that. I think I can eliminate the status update then too. In reply to: 356777545 [](ancestors = 356777545) |
||
|
||
// Add in a new sys info | ||
await this.addSysInfo(SysInfoReason.New); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kernel.kernelSpec?
isn't necessary, as the if condition has ensuredkernelSpec
isn't undefined.