Skip to content

Commit 8dcaaff

Browse files
authored
Validate python when nb opened not on extension activates (#11087)
For #10893
1 parent 4a3e37f commit 8dcaaff

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

news/2 Fixes/10893.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Performa validation of interpreter only when a Notebook is opened instead of when extension activates.

src/client/datascience/activation.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@ export class Activation implements IExtensionSingleActivationService {
2828
public async activate(): Promise<void> {
2929
this.disposables.push(this.notebookEditorProvider.onDidOpenNotebookEditor(this.onDidOpenNotebookEditor, this));
3030
this.disposables.push(this.jupyterInterpreterService.onDidChangeInterpreter(this.onDidChangeInterpreter, this));
31-
// Warm up our selected interpreter for the extension
32-
this.jupyterInterpreterService.setInitialInterpreter().ignoreErrors();
3331
this.contextService.activate().ignoreErrors();
3432
}
3533

3634
private onDidOpenNotebookEditor(_: INotebookEditor) {
3735
this.notebookOpened = true;
3836
this.PreWarmDaemonPool().ignoreErrors();
3937
sendTelemetryEvent(Telemetry.OpenNotebookAll);
38+
// Warm up our selected interpreter for the extension
39+
this.jupyterInterpreterService.setInitialInterpreter().ignoreErrors();
4040
}
4141

4242
private onDidChangeInterpreter() {
4343
if (this.notebookOpened) {
44+
// Warm up our selected interpreter for the extension
45+
this.jupyterInterpreterService.setInitialInterpreter().ignoreErrors();
4446
this.PreWarmDaemonPool().ignoreErrors();
4547
}
4648
}

0 commit comments

Comments
 (0)