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

No active PythonEnv controller for new kernel pick #11933

Merged
merged 1 commit into from
Nov 7, 2022
Merged
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
23 changes: 14 additions & 9 deletions src/notebooks/controllers/controllerLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { IPythonExtensionChecker } from '../../platform/api/types';
import { IVSCodeNotebook } from '../../platform/common/application/types';
import { isCancellationError } from '../../platform/common/cancellation';
import { InteractiveWindowView, JupyterNotebookView } from '../../platform/common/constants';
import { IDisposableRegistry } from '../../platform/common/types';
import { IConfigurationService, IDisposableRegistry } from '../../platform/common/types';
import { getNotebookMetadata } from '../../platform/common/utils';
import { noop } from '../../platform/common/utils/misc';
import { IInterpreterService } from '../../platform/interpreter/contracts';
Expand All @@ -34,7 +34,8 @@ export class ControllerLoader implements IControllerLoader, IExtensionSyncActiva
@inject(IKernelFinder) private readonly kernelFinder: IKernelFinder,
@inject(IPythonExtensionChecker) private readonly extensionChecker: IPythonExtensionChecker,
@inject(IInterpreterService) private readonly interpreters: IInterpreterService,
@inject(IControllerRegistration) private readonly registration: IControllerRegistration
@inject(IControllerRegistration) private readonly registration: IControllerRegistration,
@inject(IConfigurationService) private readonly configService: IConfigurationService
) {}

public activate(): void {
Expand Down Expand Up @@ -72,13 +73,17 @@ export class ControllerLoader implements IControllerLoader, IExtensionSyncActiva
}

if (isPythonNotebook(getNotebookMetadata(document)) && this.extensionChecker.isPythonExtensionInstalled) {
// If we know we're dealing with a Python notebook, load the active interpreter as a kernel asap.
createActiveInterpreterController(
JupyterNotebookView,
document.uri,
this.interpreters,
this.registration
).catch(noop);
const useNewKernelPicker = this.configService.getSettings().kernelPickerType === 'Insiders';
// No need to always display active python env in VS Codes controller list.
if (!useNewKernelPicker) {
// If we know we're dealing with a Python notebook, load the active interpreter as a kernel asap.
createActiveInterpreterController(
JupyterNotebookView,
document.uri,
this.interpreters,
this.registration
).catch(noop);
}
}
}

Expand Down