3
3
import * as vscode from "vscode" ;
4
4
import { leetCodeManager } from "../leetCodeManager" ;
5
5
import { IQuickItemEx , leetCodeBinaryPath } from "../shared" ;
6
- import * as cp from "../utils/cpUtils" ;
6
+ import { executeCommand } from "../utils/cpUtils" ;
7
7
import { DialogType , promptForOpenOutputChannel , promptForSignIn } from "../utils/uiUtils" ;
8
8
9
9
export async function getSessionList ( channel : vscode . OutputChannel ) : Promise < ISession [ ] > {
@@ -12,7 +12,7 @@ export async function getSessionList(channel: vscode.OutputChannel): Promise<ISe
12
12
promptForSignIn ( ) ;
13
13
return [ ] ;
14
14
}
15
- const result : string = await cp . executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" ] ) ;
15
+ const result : string = await executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" ] ) ;
16
16
const lines : string [ ] = result . split ( "\n" ) ;
17
17
const sessions : ISession [ ] = [ ] ;
18
18
const reg : RegExp = / ( .? ) \s * ( \d + ) \s + ( .* ) \s + ( \d + \( \s * \d + \. \d + % \) ) \s + ( \d + \( \s * \d + \. \d + % \) ) / ;
@@ -41,11 +41,11 @@ export async function selectSession(channel: vscode.OutputChannel): Promise<void
41
41
return ;
42
42
}
43
43
try {
44
- await cp . executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" , "-e" , choice . value ] ) ;
44
+ await executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" , "-e" , choice . value ] ) ;
45
45
vscode . window . showInformationMessage ( `Successfully switched to session '${ choice . label } '.` ) ;
46
46
await vscode . commands . executeCommand ( "leetcode.refreshExplorer" ) ;
47
47
} catch ( error ) {
48
- await promptForOpenOutputChannel ( "Failed to switch session. Please open the output channel for details" , DialogType . error , channel ) ;
48
+ await promptForOpenOutputChannel ( "Failed to switch session. Please open the output channel for details. " , DialogType . error , channel ) ;
49
49
}
50
50
}
51
51
@@ -67,7 +67,7 @@ async function parseSessionsToPicks(channel: vscode.OutputChannel): Promise<Arra
67
67
} ) ;
68
68
resolve ( picks ) ;
69
69
} catch ( error ) {
70
- return await promptForOpenOutputChannel ( "Failed to list sessions. Please open the output channel for details" , DialogType . error , channel ) ;
70
+ return await promptForOpenOutputChannel ( "Failed to list sessions. Please open the output channel for details. " , DialogType . error , channel ) ;
71
71
}
72
72
} ) ;
73
73
}
@@ -81,10 +81,10 @@ export async function createSession(channel: vscode.OutputChannel): Promise<void
81
81
return ;
82
82
}
83
83
try {
84
- await cp . executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" , "-c" , session ] ) ;
84
+ await executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" , "-c" , session ] ) ;
85
85
vscode . window . showInformationMessage ( "New session created, you can switch to it by clicking the status bar." ) ;
86
86
} catch ( error ) {
87
- await promptForOpenOutputChannel ( "Failed to create session. Please open the output channel for details" , DialogType . error , channel ) ;
87
+ await promptForOpenOutputChannel ( "Failed to create session. Please open the output channel for details. " , DialogType . error , channel ) ;
88
88
}
89
89
}
90
90
0 commit comments