@@ -128,6 +128,7 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand implem
128
128
input : IMultiStepInput < InterpreterStateArgs > ,
129
129
state : InterpreterStateArgs ,
130
130
filter ?: ( i : PythonEnvironment ) => boolean ,
131
+ params ?: { placeholder ?: string | null ; title ?: string | null } ,
131
132
) : Promise < void | InputStep < InterpreterStateArgs > > {
132
133
// If the list is refreshing, it's crucial to maintain sorting order at all
133
134
// times so that the visible items do not change.
@@ -138,19 +139,26 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand implem
138
139
this . configurationService . getSettings ( state . workspace ) . pythonPath ,
139
140
state . workspace ? state . workspace . fsPath : undefined ,
140
141
) ;
142
+ const placeholder =
143
+ params ?. placeholder === null
144
+ ? undefined
145
+ : params ?. placeholder ??
146
+ localize (
147
+ 'InterpreterQuickPickList.quickPickListPlaceholder' ,
148
+ 'Selected Interpreter: {0}' ,
149
+ currentInterpreterPathDisplay ,
150
+ ) ;
151
+ const title =
152
+ params ?. title === null ? undefined : params ?. title ?? InterpreterQuickPickList . browsePath . openButtonLabel ;
141
153
const selection = await input . showQuickPick < QuickPickType , IQuickPickParameters < QuickPickType > > ( {
142
- placeholder : localize (
143
- 'InterpreterQuickPickList.quickPickListPlaceholder' ,
144
- 'Selected Interpreter: {0}' ,
145
- currentInterpreterPathDisplay ,
146
- ) ,
154
+ placeholder,
147
155
items : suggestions ,
148
156
sortByLabel : ! preserveOrderWhenFiltering ,
149
157
keepScrollPosition : true ,
150
158
activeItem : this . getActiveItem ( state . workspace , suggestions ) , // Use a promise here to ensure quickpick is initialized synchronously.
151
159
matchOnDetail : true ,
152
160
matchOnDescription : true ,
153
- title : InterpreterQuickPickList . browsePath . openButtonLabel ,
161
+ title,
154
162
customButtonSetups : [
155
163
{
156
164
button : this . refreshButton ,
@@ -503,10 +511,11 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand implem
503
511
public async getInterpreterViaQuickPick (
504
512
workspace : Resource ,
505
513
filter : ( ( i : PythonEnvironment ) => boolean ) | undefined ,
514
+ params ?: { placeholder ?: string | null ; title ?: string | null } ,
506
515
) : Promise < string | undefined > {
507
516
const interpreterState : InterpreterStateArgs = { path : undefined , workspace } ;
508
517
const multiStep = this . multiStepFactory . create < InterpreterStateArgs > ( ) ;
509
- await multiStep . run ( ( input , s ) => this . _pickInterpreter ( input , s , filter ) , interpreterState ) ;
518
+ await multiStep . run ( ( input , s ) => this . _pickInterpreter ( input , s , filter , params ) , interpreterState ) ;
510
519
return interpreterState . path ;
511
520
}
512
521
0 commit comments