@@ -14,18 +14,23 @@ import { GLOBAL_MEMENTO, IExtensions, IMemento, Resource } from '../common/types
14
14
import { getDebugpyPackagePath } from '../debugger/extension/adapter/remoteLaunchers' ;
15
15
import { IEnvironmentActivationService } from '../interpreter/activation/types' ;
16
16
import { IInterpreterQuickPickItem , IInterpreterSelector } from '../interpreter/configuration/types' ;
17
- import { ICondaService , IInterpreterDisplay , IInterpreterStatusbarVisibilityFilter } from '../interpreter/contracts' ;
18
- import { PythonEnvironment } from '../pythonEnvironments/info' ;
17
+ import {
18
+ ICondaService ,
19
+ IInterpreterDisplay ,
20
+ IInterpreterService ,
21
+ IInterpreterStatusbarVisibilityFilter ,
22
+ } from '../interpreter/contracts' ;
19
23
import { PylanceApi } from '../activation/node/pylanceApi' ;
20
24
import { ExtensionContextKey } from '../common/application/contextKeys' ;
25
+ import type { Environment } from '../api/types' ;
21
26
22
27
type PythonApiForJupyterExtension = {
23
28
/**
24
29
* IEnvironmentActivationService
25
30
*/
26
31
getActivatedEnvironmentVariables (
27
32
resource : Resource ,
28
- interpreter ?: PythonEnvironment ,
33
+ interpreter : Environment ,
29
34
allowExceptions ?: boolean ,
30
35
) : Promise < NodeJS . ProcessEnv | undefined > ;
31
36
getKnownSuggestions ( resource : Resource ) : IInterpreterQuickPickItem [ ] ;
@@ -82,6 +87,7 @@ export class JupyterExtensionIntegration {
82
87
@inject ( IWorkspaceService ) private workspaceService : IWorkspaceService ,
83
88
@inject ( ICondaService ) private readonly condaService : ICondaService ,
84
89
@inject ( IContextKeyManager ) private readonly contextManager : IContextKeyManager ,
90
+ @inject ( IInterpreterService ) private interpreterService : IInterpreterService ,
85
91
) { }
86
92
87
93
public registerApi ( jupyterExtensionApi : JupyterExtensionApi ) : JupyterExtensionApi | undefined {
@@ -94,9 +100,12 @@ export class JupyterExtensionIntegration {
94
100
jupyterExtensionApi . registerPythonApi ( {
95
101
getActivatedEnvironmentVariables : async (
96
102
resource : Resource ,
97
- interpreter ?: PythonEnvironment ,
103
+ env : Environment ,
98
104
allowExceptions ?: boolean ,
99
- ) => this . envActivation . getActivatedEnvironmentVariables ( resource , interpreter , allowExceptions ) ,
105
+ ) => {
106
+ const interpreter = await this . interpreterService . getInterpreterDetails ( env . path ) ;
107
+ return this . envActivation . getActivatedEnvironmentVariables ( resource , interpreter , allowExceptions ) ;
108
+ } ,
100
109
getSuggestions : async ( resource : Resource ) : Promise < IInterpreterQuickPickItem [ ] > =>
101
110
this . interpreterSelector . getAllSuggestions ( resource ) ,
102
111
getKnownSuggestions : ( resource : Resource ) : IInterpreterQuickPickItem [ ] =>
0 commit comments