@@ -16,7 +16,6 @@ import {
16
16
CURRENT_PATH_SERVICE ,
17
17
GetInterpreterLocatorOptions ,
18
18
GLOBAL_VIRTUAL_ENV_SERVICE ,
19
- IComponentAdapter ,
20
19
IInterpreterLocatorHelper ,
21
20
IInterpreterLocatorService ,
22
21
KNOWN_PATH_SERVICE ,
@@ -182,12 +181,6 @@ export class WorkspaceLocators extends LazyResourceBasedLocator {
182
181
}
183
182
}
184
183
185
- // The parts of IComponentAdapter used here.
186
- interface IComponent {
187
- hasInterpreters : Promise < boolean | undefined > ;
188
- getInterpreters ( resource ?: Uri , options ?: GetInterpreterLocatorOptions ) : Promise < PythonEnvironment [ ] | undefined > ;
189
- }
190
-
191
184
/**
192
185
* Facilitates locating Python interpreters.
193
186
*/
@@ -207,10 +200,7 @@ export class PythonInterpreterLocatorService implements IInterpreterLocatorServi
207
200
Promise < PythonEnvironment [ ] >
208
201
> ( ) ;
209
202
210
- constructor (
211
- @inject ( IServiceContainer ) private serviceContainer : IServiceContainer ,
212
- @inject ( IComponentAdapter ) private readonly pyenvs : IComponent ,
213
- ) {
203
+ constructor ( @inject ( IServiceContainer ) private serviceContainer : IServiceContainer ) {
214
204
this . _hasInterpreters = createDeferred < boolean > ( ) ;
215
205
serviceContainer . get < Disposable [ ] > ( IDisposableRegistry ) . push ( this ) ;
216
206
this . platform = serviceContainer . get < IPlatformService > ( IPlatformService ) ;
@@ -231,12 +221,7 @@ export class PythonInterpreterLocatorService implements IInterpreterLocatorServi
231
221
}
232
222
233
223
public get hasInterpreters ( ) : Promise < boolean > {
234
- return this . pyenvs . hasInterpreters . then ( ( res ) => {
235
- if ( res !== undefined ) {
236
- return res ;
237
- }
238
- return this . _hasInterpreters . completed ? this . _hasInterpreters . promise : Promise . resolve ( false ) ;
239
- } ) ;
224
+ return this . _hasInterpreters . completed ? this . _hasInterpreters . promise : Promise . resolve ( false ) ;
240
225
}
241
226
242
227
/**
@@ -256,10 +241,6 @@ export class PythonInterpreterLocatorService implements IInterpreterLocatorServi
256
241
*/
257
242
@traceDecorators . verbose ( 'Get Interpreters' )
258
243
public async getInterpreters ( resource ?: Uri , options ?: GetInterpreterLocatorOptions ) : Promise < PythonEnvironment [ ] > {
259
- const envs = await this . pyenvs . getInterpreters ( resource , options ) ;
260
- if ( envs !== undefined ) {
261
- return envs ;
262
- }
263
244
const locators = this . getLocators ( options ) ;
264
245
const promises = locators . map ( async ( provider ) => provider . getInterpreters ( resource ) ) ;
265
246
locators . forEach ( ( locator ) => {
0 commit comments