File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 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> {
343343 if ( documents . length == 0 ) {
344344 return ;
345345 }
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 ;
346367 // Prompt the user for the export destination
347368 const uri = await vscode . window . showSaveDialog ( {
348369 saveLabel : "Export" ,
You can’t perform that action at this time.
0 commit comments