File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,27 @@ export async function exportDocumentsToXMLFile(): Promise<void> {
343
343
if ( documents . length == 0 ) {
344
344
return ;
345
345
}
346
+ // Prompt the user to confirm their choices
347
+ const confirmed = await new Promise < boolean > ( ( resolve ) => {
348
+ const quickPick = vscode . window . createQuickPick ( ) ;
349
+ quickPick . title = `Export the following ${ documents . length > 1 ? `${ documents . length } documents` : "document" } ?` ;
350
+ quickPick . placeholder = "Click any item to confirm, or 'Escape' to cancel" ;
351
+ quickPick . ignoreFocusOut = true ;
352
+ quickPick . onDidChangeSelection ( ( e ) => outputChannel . appendLine ( JSON . stringify ( e ) ) ) ;
353
+ quickPick . onDidAccept ( ( ) => {
354
+ resolve ( true ) ;
355
+ quickPick . hide ( ) ;
356
+ } ) ;
357
+ quickPick . onDidHide ( ( ) => {
358
+ resolve ( false ) ;
359
+ quickPick . dispose ( ) ;
360
+ } ) ;
361
+ quickPick . items = documents . sort ( ) . map ( ( d ) => {
362
+ return { label : d } ;
363
+ } ) ;
364
+ quickPick . show ( ) ;
365
+ } ) ;
366
+ if ( ! confirmed ) return ;
346
367
// Prompt the user for the export destination
347
368
const uri = await vscode . window . showSaveDialog ( {
348
369
saveLabel : "Export" ,
You can’t perform that action at this time.
0 commit comments