MCPcopy Index your code
hub / github.com/LeetCode-OpenSource/vscode-leetcode / parseSessionsToPicks

Function parseSessionsToPicks

src/commands/session.ts:57–76  ·  view source on GitHub ↗
(includeOperations: boolean = false)

Source from the content-addressed store, hash-verified

55}
56
57async 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
78function parseSessionManagementOperations(): Array<IQuickItemEx<string>> {
79 return [{

Callers 2

manageSessionsFunction · 0.85
deleteSessionFunction · 0.85

Calls 3

getSessionListFunction · 0.85

Tested by

no test coverage detected