Skip to content

Commit

Permalink
Fix #167683. Show selected kernel name during kernel detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Nov 30, 2022
1 parent cec4114 commit 09c3221
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,19 @@ export class KernelPickerFlatStrategy extends KernelPickerStrategyBase {
static updateKernelStatusAction(notebook: NotebookTextModel, action: IAction, notebookKernelService: INotebookKernelService, scopedContextKeyService?: IContextKeyService) {
const detectionTasks = notebookKernelService.getKernelDetectionTasks(notebook);
if (detectionTasks.length) {
const info = notebookKernelService.getMatchingKernel(notebook);
action.enabled = true;
action.label = localize('kernels.detecting', "Detecting Kernels");
action.class = ThemeIcon.asClassName(ThemeIcon.modify(executingStateIcon, 'spin'));

if (info.selected) {
action.label = info.selected.label;
const kernelInfo = info.selected.description ?? info.selected.detail;
action.tooltip = kernelInfo
? localize('kernels.selectedKernelAndKernelDetectionRunning', "Selected Kernel: {0} (Kernel Detection Tasks Running)", kernelInfo)
: localize('kernels.detecting', "Detecting Kernels");
} else {
action.label = localize('kernels.detecting', "Detecting Kernels");
}
return;
}

Expand Down Expand Up @@ -820,9 +830,19 @@ export class KernelPickerMRUStrategy extends KernelPickerStrategyBase {
static updateKernelStatusAction(notebook: NotebookTextModel, action: IAction, notebookKernelService: INotebookKernelService) {
const detectionTasks = notebookKernelService.getKernelDetectionTasks(notebook);
if (detectionTasks.length) {
const info = notebookKernelService.getMatchingKernel(notebook);
action.enabled = true;
action.label = localize('kernels.detecting', "Detecting Kernels");
action.class = ThemeIcon.asClassName(ThemeIcon.modify(executingStateIcon, 'spin'));

if (info.selected) {
action.label = info.selected.label;
const kernelInfo = info.selected.description ?? info.selected.detail;
action.tooltip = kernelInfo
? localize('kernels.selectedKernelAndKernelDetectionRunning', "Selected Kernel: {0} (Kernel Detection Tasks Running)", kernelInfo)
: localize('kernels.detecting', "Detecting Kernels");
} else {
action.label = localize('kernels.detecting', "Detecting Kernels");
}
return;
}

Expand Down

0 comments on commit 09c3221

Please sign in to comment.