@@ -74,29 +74,30 @@ export class JupyterExtensionIntegration {
74
74
return ;
75
75
}
76
76
await jupyterExtension . activate ( ) ;
77
- if ( jupyterExtension . isActive ) {
78
- const jupyterExtensionApi = jupyterExtension . exports ;
79
- jupyterExtensionApi . registerPythonApi ( {
80
- onDidChangeInterpreter : this . interpreterService . onDidChangeInterpreter ,
81
- getActiveInterpreter : async ( resource ?: Uri ) => this . interpreterService . getActiveInterpreter ( resource ) ,
82
- getInterpreterDetails : async ( pythonPath : string ) =>
83
- this . interpreterService . getInterpreterDetails ( pythonPath ) ,
84
- getInterpreters : async ( resource : Uri | undefined ) => this . interpreterService . getInterpreters ( resource ) ,
85
- getActivatedEnvironmentVariables : async (
86
- resource : Resource ,
87
- interpreter ?: PythonEnvironment ,
88
- allowExceptions ?: boolean
89
- ) => this . envActivation . getActivatedEnvironmentVariables ( resource , interpreter , allowExceptions ) ,
90
- isWindowsStoreInterpreter : async ( pythonPath : string ) : Promise < boolean > =>
91
- this . windowsStoreInterpreter . isWindowsStoreInterpreter ( pythonPath ) ,
92
- getSuggestions : async ( resource : Resource ) : Promise < IInterpreterQuickPickItem [ ] > =>
93
- this . interpreterSelector . getSuggestions ( resource ) ,
94
- install : async (
95
- product : Product ,
96
- resource ?: InterpreterUri ,
97
- cancel ?: CancellationToken
98
- ) : Promise < InstallerResponse > => this . installer . install ( product , resource , cancel )
99
- } ) ;
77
+ if ( ! jupyterExtension . isActive ) {
78
+ return ;
100
79
}
80
+ const jupyterExtensionApi = jupyterExtension . exports ;
81
+ jupyterExtensionApi . registerPythonApi ( {
82
+ onDidChangeInterpreter : this . interpreterService . onDidChangeInterpreter ,
83
+ getActiveInterpreter : async ( resource ?: Uri ) => this . interpreterService . getActiveInterpreter ( resource ) ,
84
+ getInterpreterDetails : async ( pythonPath : string ) =>
85
+ this . interpreterService . getInterpreterDetails ( pythonPath ) ,
86
+ getInterpreters : async ( resource : Uri | undefined ) => this . interpreterService . getInterpreters ( resource ) ,
87
+ getActivatedEnvironmentVariables : async (
88
+ resource : Resource ,
89
+ interpreter ?: PythonEnvironment ,
90
+ allowExceptions ?: boolean
91
+ ) => this . envActivation . getActivatedEnvironmentVariables ( resource , interpreter , allowExceptions ) ,
92
+ isWindowsStoreInterpreter : async ( pythonPath : string ) : Promise < boolean > =>
93
+ this . windowsStoreInterpreter . isWindowsStoreInterpreter ( pythonPath ) ,
94
+ getSuggestions : async ( resource : Resource ) : Promise < IInterpreterQuickPickItem [ ] > =>
95
+ this . interpreterSelector . getSuggestions ( resource ) ,
96
+ install : async (
97
+ product : Product ,
98
+ resource ?: InterpreterUri ,
99
+ cancel ?: CancellationToken
100
+ ) : Promise < InstallerResponse > => this . installer . install ( product , resource , cancel )
101
+ } ) ;
101
102
}
102
103
}
0 commit comments