From 254021e2f690f7d0efd59b75b726b3af7f96ca10 Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Tue, 18 Mar 2025 07:52:22 -0400 Subject: [PATCH] Add confirmation step for XML export --- src/commands/export.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/commands/export.ts b/src/commands/export.ts index bc811ca4..5105de58 100644 --- a/src/commands/export.ts +++ b/src/commands/export.ts @@ -343,6 +343,27 @@ export async function exportDocumentsToXMLFile(): Promise { if (documents.length == 0) { return; } + // Prompt the user to confirm their choices + const confirmed = await new Promise((resolve) => { + const quickPick = vscode.window.createQuickPick(); + quickPick.title = `Export the following ${documents.length > 1 ? `${documents.length} documents` : "document"}?`; + quickPick.placeholder = "Click any item to confirm, or 'Escape' to cancel"; + quickPick.ignoreFocusOut = true; + quickPick.onDidChangeSelection((e) => outputChannel.appendLine(JSON.stringify(e))); + quickPick.onDidAccept(() => { + resolve(true); + quickPick.hide(); + }); + quickPick.onDidHide(() => { + resolve(false); + quickPick.dispose(); + }); + quickPick.items = documents.sort().map((d) => { + return { label: d }; + }); + quickPick.show(); + }); + if (!confirmed) return; // Prompt the user for the export destination const uri = await vscode.window.showSaveDialog({ saveLabel: "Export",