(prompt: string, confirmation?: string, detail?: string)
| 230 | // shows a quick pick asking the user for confirmation |
| 231 | // returns true if the user confirms, false if they cancel or dismiss the quickpick |
| 232 | export async function getConfirmation(prompt: string, confirmation?: string, detail?: string): Promise<boolean> { |
| 233 | confirmation ||= 'Yes'; |
| 234 | const items: vscode.QuickPickItem[] = [ |
| 235 | { |
| 236 | label: confirmation, |
| 237 | detail: detail |
| 238 | }, |
| 239 | { |
| 240 | label: 'Cancel' |
| 241 | } |
| 242 | ]; |
| 243 | const answer = await vscode.window.showQuickPick(items, { |
| 244 | placeHolder: prompt |
| 245 | }); |
| 246 | return answer === items[0]; |
| 247 | } |
| 248 | |
| 249 | // executes a given command as shell task |
| 250 | // is more transparent than background processes without littering the integrated terminals |
no outgoing calls
no test coverage detected