(
items: ICheckboxQuickPickItem[],
options: ICheckboxQuickPickOptions,
)
| 48 | } |
| 49 | |
| 50 | async function showInner( |
| 51 | items: ICheckboxQuickPickItem[], |
| 52 | options: ICheckboxQuickPickOptions, |
| 53 | ): Promise<vscode.QuickPickItem | undefined> { |
| 54 | const selection = await vscode.window.showQuickPick( |
| 55 | getQuickPickItems(items), |
| 56 | { |
| 57 | ignoreFocusOut: true, |
| 58 | matchOnDescription: true, |
| 59 | placeHolder: options.confirmPlaceHolder, |
| 60 | }, |
| 61 | ); |
| 62 | |
| 63 | if (selection === undefined) { |
| 64 | return undefined; |
| 65 | } |
| 66 | |
| 67 | if (selection.label === confirmItemLabel) { |
| 68 | return selection; |
| 69 | } |
| 70 | |
| 71 | const index: number = getItemIndex(items, selection.label); |
| 72 | if (index >= 0) { |
| 73 | toggleSelection(items[index]); |
| 74 | } else { |
| 75 | console.log( |
| 76 | `Couldn't find CheckboxQuickPickItem for label '${selection.label}'`, |
| 77 | ); |
| 78 | } |
| 79 | |
| 80 | return showInner(items, options); |
| 81 | } |
| 82 | |
| 83 | function getItemIndex( |
| 84 | items: ICheckboxQuickPickItem[], |
no test coverage detected