(placeHolder: string, packages: Package[])
| 414 | |
| 415 | // Used to let the user confirm their choice when installing/removing packages |
| 416 | async function confirmPackages(placeHolder: string, packages: Package[]): Promise<Package[]> { |
| 417 | const qpItems: (vscode.QuickPickItem & {package: Package})[] = packages.map(pkg => ({ |
| 418 | label: pkg.name, |
| 419 | detail: pkg.description, |
| 420 | package: pkg, |
| 421 | picked: true |
| 422 | })); |
| 423 | const qpOptions: vscode.QuickPickOptions = { |
| 424 | matchOnDescription: true, |
| 425 | matchOnDetail: true, |
| 426 | placeHolder: placeHolder |
| 427 | }; |
| 428 | const qp = await vscode.window.showQuickPick(qpItems, {...qpOptions, canPickMany: true}); |
| 429 | const ret = qp?.map(v => v.package) || []; |
| 430 | return ret; |
| 431 | } |
| 432 | |
| 433 | // Let the user pick a package, either from local installation or CRAN |
| 434 | async function pickPackages(packages: Package[], placeHolder: string, pickMany: boolean = false): Promise<Package[]|undefined> { |
no outgoing calls
no test coverage detected