Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf2b1a75

Browse files
authored
change the place of the lock decorator (LeetCode-OpenSource#23)
1 parenta44d3db commitf2b1a75

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎src/commands/show.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,22 @@ async function showProblemInternal(channel: vscode.OutputChannel, id: string): P
7979
asyncfunctionparseProblemsToPicks(p:Promise<list.IProblem[]>):Promise<Array<IQuickItemEx<string>>>{
8080
returnnewPromise(async(resolve:(res:Array<IQuickItemEx<string>>)=>void):Promise<void>=>{
8181
constpicks:Array<IQuickItemEx<string>>=(awaitp).map((problem:list.IProblem)=>Object.assign({},{
82-
label:`${parseProblemDecorator(problem.state)}${problem.id}.${problem.name}`,
82+
label:`${parseProblemDecorator(problem.state,problem.locked)}${problem.id}.${problem.name}`,
8383
description:"",
84-
detail:`${parseLockDecorator(problem.locked)}AC rate:${problem.passRate}, Difficulty:${problem.difficulty}`,
84+
detail:`AC rate:${problem.passRate}, Difficulty:${problem.difficulty}`,
8585
value:problem.id,
8686
}));
8787
resolve(picks);
8888
});
8989
}
9090

91-
functionparseProblemDecorator(state:ProblemState):string{
91+
functionparseProblemDecorator(state:ProblemState,locked:boolean):string{
9292
switch(state){
9393
caseProblemState.AC:
9494
return"$(check) ";
9595
caseProblemState.NotAC:
9696
return"$(x) ";
9797
default:
98-
return"";
98+
returnlocked ?"$(lock) " :"";
9999
}
100100
}
101-
102-
functionparseLockDecorator(locked:boolean):string{
103-
returnlocked ?"$(lock) " :"";
104-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp