MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / confirmPackages

Function confirmPackages

src/helpViewer/packages.ts:416–431  ·  view source on GitHub ↗
(placeHolder: string, packages: Package[])

Source from the content-addressed store, hash-verified

414
415// Used to let the user confirm their choice when installing/removing packages
416async 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
434async function pickPackages(packages: Package[], placeHolder: string, pickMany: boolean = false): Promise<Package[]|undefined> {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected