11import { inject , injectable } from 'inversify' ;
2- import { ConfigurationTarget , Disposable , QuickPickItem , QuickPickOptions , Uri } from 'vscode' ;
2+ import { ConfigurationTarget , Disposable , QuickPickOptions , Uri } from 'vscode' ;
33import { IApplicationShell , ICommandManager , IDocumentManager , IWorkspaceService } from '../../common/application/types' ;
44import { Commands } from '../../common/constants' ;
5- import { IConfigurationService , IPathUtils } from '../../common/types' ;
5+ import { IConfigurationService , IPathUtils , Resource } from '../../common/types' ;
66import { IInterpreterService , IShebangCodeLensProvider , PythonInterpreter , WorkspacePythonPath } from '../contracts' ;
7- import { IInterpreterComparer , IInterpreterSelector , IPythonPathUpdaterServiceManager } from './types' ;
8-
9- export interface IInterpreterQuickPickItem extends QuickPickItem {
10- path : string ;
11- }
7+ import { IInterpreterComparer , IInterpreterQuickPickItem , IInterpreterSelector , IPythonPathUpdaterServiceManager } from './types' ;
128
139@injectable ( )
1410export class InterpreterSelector implements IInterpreterSelector {
@@ -34,10 +30,10 @@ export class InterpreterSelector implements IInterpreterSelector {
3430 this . disposables . push ( this . commandManager . registerCommand ( Commands . Set_ShebangInterpreter , this . setShebangInterpreter . bind ( this ) ) ) ;
3531 }
3632
37- public async getSuggestions ( resourceUri ?: Uri ) {
38- const interpreters = await this . interpreterManager . getInterpreters ( resourceUri ) ;
33+ public async getSuggestions ( resource : Resource ) {
34+ const interpreters = await this . interpreterManager . getInterpreters ( resource ) ;
3935 interpreters . sort ( this . interpreterComparer . compare . bind ( this . interpreterComparer ) ) ;
40- return Promise . all ( interpreters . map ( item => this . suggestionToQuickPickItem ( item , resourceUri ) ) ) ;
36+ return Promise . all ( interpreters . map ( item => this . suggestionToQuickPickItem ( item , resource ) ) ) ;
4137 }
4238 protected async suggestionToQuickPickItem ( suggestion : PythonInterpreter , workspaceUri ?: Uri ) : Promise < IInterpreterQuickPickItem > {
4339 const detail = this . pathUtils . getDisplayName ( suggestion . path , workspaceUri ? workspaceUri . fsPath : undefined ) ;
0 commit comments