@@ -206,7 +206,7 @@ async function modifyWsFolderUri(uri: vscode.Uri): Promise<vscode.Uri | undefine
206
206
}
207
207
208
208
let newParams = "" ;
209
- let newPath = "/" ;
209
+ let newPath = uri . path ;
210
210
if ( filterType == "csp" ) {
211
211
// Prompt for a specific web app
212
212
let cspApps = cspAppsForUri ( uri ) ;
@@ -237,11 +237,36 @@ async function modifyWsFolderUri(uri: vscode.Uri): Promise<vscode.Uri | undefine
237
237
return ;
238
238
}
239
239
}
240
- newPath =
241
- ( await vscode . window . showQuickPick ( cspApps , {
242
- placeHolder : "Pick a specific web application to show, or press 'Escape' to show all" ,
243
- ignoreFocusOut : true ,
244
- } ) ) ?? "/" ;
240
+ newPath = await new Promise < string | undefined > ( ( resolve ) => {
241
+ let result : string ;
242
+ const allItem : vscode . QuickPickItem = { label : "All" } ;
243
+ const quickPick = vscode . window . createQuickPick ( ) ;
244
+ quickPick . placeholder = "Pick a specific web application to show, or show all" ;
245
+ quickPick . ignoreFocusOut = true ;
246
+ quickPick . items = [
247
+ allItem ,
248
+ ...cspApps . map ( ( label ) => {
249
+ return { label } ;
250
+ } ) ,
251
+ ] ;
252
+ const activeIdx = quickPick . items . findIndex ( ( i ) => i . label == uri . path ) ;
253
+ quickPick . activeItems = [ quickPick . items [ activeIdx == - 1 ? 0 : activeIdx ] ] ;
254
+
255
+ quickPick . onDidChangeSelection ( ( items ) => {
256
+ result = items [ 0 ] . label == allItem . label ? "/" : items [ 0 ] . label ;
257
+ } ) ;
258
+ quickPick . onDidAccept ( ( ) => {
259
+ quickPick . hide ( ) ;
260
+ } ) ;
261
+ quickPick . onDidHide ( ( ) => {
262
+ resolve ( result ) ;
263
+ quickPick . dispose ( ) ;
264
+ } ) ;
265
+ quickPick . show ( ) ;
266
+ } ) ;
267
+ if ( ! newPath ) {
268
+ return ;
269
+ }
245
270
newParams = "csp" ;
246
271
} else if ( filterType == "project" ) {
247
272
// Prompt for project
0 commit comments