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

Function parseProblemsToPicks

src/commands/show.ts:196–206  ·  view source on GitHub ↗
(p: Promise<IProblem[]>)

Source from the content-addressed store, hash-verified

194 return previewProblem(node, vscode.workspace.getConfiguration("leetcode").get<boolean>("enableSideMode", true));
195}
196async function parseProblemsToPicks(p: Promise<IProblem[]>): Promise<Array<IQuickItemEx<IProblem>>> {
197 return new Promise(async (resolve: (res: Array<IQuickItemEx<IProblem>>) => void): Promise<void> => {
198 const picks: Array<IQuickItemEx<IProblem>> = (await p).map((problem: IProblem) => Object.assign({}, {
199 label: `${parseProblemDecorator(problem.state, problem.locked)}${problem.id}.${problem.name}`,
200 description: "",
201 detail: `AC rate: ${problem.passRate}, Difficulty: ${problem.difficulty}`,
202 value: problem,
203 }));
204 resolve(picks);
205 });
206}
207
208function parseProblemDecorator(state: ProblemState, locked: boolean): string {
209 switch (state) {

Callers 1

searchProblemFunction · 0.85

Calls 1

parseProblemDecoratorFunction · 0.85

Tested by

no test coverage detected