(includeOperations: boolean = false)
| 55 | } |
| 56 | |
| 57 | async function parseSessionsToPicks(includeOperations: boolean = false): Promise<Array<IQuickItemEx<ISession | string>>> { |
| 58 | return new Promise(async (resolve: (res: Array<IQuickItemEx<ISession | string>>) => void): Promise<void> => { |
| 59 | try { |
| 60 | const sessions: ISession[] = await getSessionList(); |
| 61 | const picks: Array<IQuickItemEx<ISession | string>> = sessions.map((s: ISession) => Object.assign({}, { |
| 62 | label: `${s.active ? "$(check) " : ""}${s.name}`, |
| 63 | description: s.active ? "Active" : "", |
| 64 | detail: `AC Questions: ${s.acQuestions}, AC Submits: ${s.acSubmits}`, |
| 65 | value: s, |
| 66 | })); |
| 67 | |
| 68 | if (includeOperations) { |
| 69 | picks.push(...parseSessionManagementOperations()); |
| 70 | } |
| 71 | resolve(picks); |
| 72 | } catch (error) { |
| 73 | return await promptForOpenOutputChannel("Failed to list sessions. Please open the output channel for details.", DialogType.error); |
| 74 | } |
| 75 | }); |
| 76 | } |
| 77 | |
| 78 | function parseSessionManagementOperations(): Array<IQuickItemEx<string>> { |
| 79 | return [{ |
no test coverage detected