File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 42
42
43
43
- You can also use the following command to sign in/cookie in/out:
44
44
- ** LeetCode: Sign in**
45
- - ** LeetCode: Cookie in**
45
+ - ** LeetCode: Sign in (by cookie) **
46
46
- ** LeetCode: Sign out**
47
47
48
48
---
Original file line number Diff line number Diff line change 38
38
" onCommand:leetcode.testSolution" ,
39
39
" onCommand:leetcode.submitSolution" ,
40
40
" onCommand:leetcode.switchDefaultLanguage" ,
41
- " onCommand:leetcode.cookieIn " ,
41
+ " onCommand:leetcode.signinByCookie " ,
42
42
" onView:leetCodeExplorer"
43
43
],
44
44
"main" : " ./out/src/extension" ,
45
45
"contributes" : {
46
46
"commands" : [
47
47
{
48
- "command" : " leetcode.cookieIn " ,
49
- "title" : " Cookie In" ,
48
+ "command" : " leetcode.signinByCookie " ,
49
+ "title" : " Sign In By Cookie " ,
50
50
"category" : " LeetCode"
51
51
},
52
52
{
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
51
51
vscode . commands . registerCommand ( "leetcode.deleteCache" , ( ) => cache . deleteCache ( ) ) ,
52
52
vscode . commands . registerCommand ( "leetcode.toggleLeetCodeCn" , ( ) => plugin . switchEndpoint ( ) ) ,
53
53
vscode . commands . registerCommand ( "leetcode.signin" , ( ) => leetCodeManager . signIn ( ) ) ,
54
- vscode . commands . registerCommand ( "leetcode.cookieIn " , ( ) => leetCodeManager . signIn ( true ) ) ,
54
+ vscode . commands . registerCommand ( "leetcode.signinByCookie " , ( ) => leetCodeManager . signIn ( true ) ) ,
55
55
vscode . commands . registerCommand ( "leetcode.signout" , ( ) => leetCodeManager . signOut ( ) ) ,
56
56
vscode . commands . registerCommand ( "leetcode.manageSessions" , ( ) => session . manageSessions ( ) ) ,
57
57
vscode . commands . registerCommand ( "leetcode.previewProblem" , ( node : LeetCodeNode ) => show . previewProblem ( node ) ) ,
Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ class LeetCodeManager extends EventEmitter {
34
34
}
35
35
}
36
36
37
- public async signIn ( isCookieIn : boolean = false ) : Promise < void > {
37
+ public async signIn ( isByCookie : boolean = false ) : Promise < void > {
38
38
const loginArg : string = "-l" ;
39
- const cookieInArg : string = "-c" ;
40
- const commandArg : string = isCookieIn ? cookieInArg : loginArg ;
41
- const inMessage : string = isCookieIn ? "cookie in" : "sign in" ;
39
+ const cookieArg : string = "-c" ;
40
+ const commandArg : string = isByCookie ? cookieArg : loginArg ;
41
+ const inMessage : string = isByCookie ? "sign in by cookie " : "sign in" ;
42
42
try {
43
43
const userName : string | undefined = await new Promise ( async ( resolve : ( res : string | undefined ) => void , reject : ( e : Error ) => void ) : Promise < void > => {
44
44
let result : string = "" ;
@@ -71,9 +71,9 @@ class LeetCodeManager extends EventEmitter {
71
71
}
72
72
childProc . stdin . write ( `${ name } \n` ) ;
73
73
const pwd : string | undefined = await vscode . window . showInputBox ( {
74
- prompt : isCookieIn ? "Enter cookie" : "Enter password." ,
74
+ prompt : isByCookie ? "Enter cookie" : "Enter password." ,
75
75
password : true ,
76
- validateInput : ( s : string ) : string | undefined => s ? undefined : isCookieIn ? "Cookie must not be empty" : "Password must not be empty" ,
76
+ validateInput : ( s : string ) : string | undefined => s ? undefined : isByCookie ? "Cookie must not be empty" : "Password must not be empty" ,
77
77
} ) ;
78
78
if ( ! pwd ) {
79
79
childProc . kill ( ) ;
You can’t perform that action at this time.
0 commit comments