@@ -6,7 +6,6 @@ import { IProcessServiceFactory } from '../../../common/process/types';
6
6
import { IConfigurationService } from '../../../common/types' ;
7
7
import { IServiceContainer } from '../../../ioc/types' ;
8
8
import { IInterpreterHelper , InterpreterType , PythonInterpreter } from '../../contracts' ;
9
- import { IVirtualEnvironmentManager } from '../../virtualEnvs/types' ;
10
9
import { CacheableLocatorService } from './cacheableLocatorService' ;
11
10
12
11
/**
@@ -20,7 +19,6 @@ export class CurrentPathService extends CacheableLocatorService {
20
19
private readonly fs : IFileSystem ;
21
20
22
21
public constructor (
23
- @inject ( IVirtualEnvironmentManager ) private virtualEnvMgr : IVirtualEnvironmentManager ,
24
22
@inject ( IInterpreterHelper ) private helper : IInterpreterHelper ,
25
23
@inject ( IProcessServiceFactory ) private readonly processServiceFactory : IProcessServiceFactory ,
26
24
@inject ( IServiceContainer ) serviceContainer : IServiceContainer
@@ -60,28 +58,23 @@ export class CurrentPathService extends CacheableLocatorService {
60
58
. then ( listOfInterpreters => _ . flatten ( listOfInterpreters ) )
61
59
. then ( interpreters => interpreters . filter ( item => item . length > 0 ) )
62
60
// tslint:disable-next-line:promise-function-async
63
- . then ( interpreters => Promise . all ( interpreters . map ( interpreter => this . getInterpreterDetails ( interpreter , resource ) ) ) )
61
+ . then ( interpreters => Promise . all ( interpreters . map ( interpreter => this . getInterpreterDetails ( interpreter ) ) ) )
64
62
. then ( interpreters => interpreters . filter ( item => ! ! item ) . map ( item => item ! ) ) ;
65
63
}
66
64
67
65
/**
68
66
* Return the information about the identified interpreter binary.
69
67
*/
70
- private async getInterpreterDetails ( interpreter : string , resource ?: Uri ) : Promise < PythonInterpreter | undefined > {
71
- return Promise . all ( [
72
- this . helper . getInterpreterInformation ( interpreter ) ,
73
- this . virtualEnvMgr . getEnvironmentName ( interpreter , resource ) ,
74
- this . virtualEnvMgr . getEnvironmentType ( interpreter , resource )
75
- ] ) .
76
- then ( ( [ details , virtualEnvName , type ] ) => {
68
+ private async getInterpreterDetails ( interpreter : string ) : Promise < PythonInterpreter | undefined > {
69
+ return this . helper . getInterpreterInformation ( interpreter )
70
+ . then ( details => {
77
71
if ( ! details ) {
78
72
return ;
79
73
}
80
74
return {
81
75
...( details as PythonInterpreter ) ,
82
- envName : virtualEnvName ,
83
76
path : interpreter ,
84
- type : type ? type : InterpreterType . Unknown
77
+ type : details . type ? details . type : InterpreterType . Unknown
85
78
} ;
86
79
} ) ;
87
80
}
0 commit comments