33import * as vscode from "vscode" ;
44import { leetCodeManager } from "../leetCodeManager" ;
55import { IQuickItemEx , leetCodeBinaryPath } from "../shared" ;
6- import * as cp from "../utils/cpUtils" ;
6+ import { executeCommand } from "../utils/cpUtils" ;
77import { DialogType , promptForOpenOutputChannel , promptForSignIn } from "../utils/uiUtils" ;
88
99export async function getSessionList ( channel : vscode . OutputChannel ) : Promise < ISession [ ] > {
@@ -12,7 +12,7 @@ export async function getSessionList(channel: vscode.OutputChannel): Promise<ISe
1212 promptForSignIn ( ) ;
1313 return [ ] ;
1414 }
15- const result : string = await cp . executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" ] ) ;
15+ const result : string = await executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" ] ) ;
1616 const lines : string [ ] = result . split ( "\n" ) ;
1717 const sessions : ISession [ ] = [ ] ;
1818 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
4141 return ;
4242 }
4343 try {
44- await cp . executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" , "-e" , choice . value ] ) ;
44+ await executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" , "-e" , choice . value ] ) ;
4545 vscode . window . showInformationMessage ( `Successfully switched to session '${ choice . label } '.` ) ;
4646 await vscode . commands . executeCommand ( "leetcode.refreshExplorer" ) ;
4747 } 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 ) ;
4949 }
5050}
5151
@@ -67,7 +67,7 @@ async function parseSessionsToPicks(channel: vscode.OutputChannel): Promise<Arra
6767 } ) ;
6868 resolve ( picks ) ;
6969 } 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 ) ;
7171 }
7272 } ) ;
7373}
@@ -81,10 +81,10 @@ export async function createSession(channel: vscode.OutputChannel): Promise<void
8181 return ;
8282 }
8383 try {
84- await cp . executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" , "-c" , session ] ) ;
84+ await executeCommand ( channel , "node" , [ leetCodeBinaryPath , "session" , "-c" , session ] ) ;
8585 vscode . window . showInformationMessage ( "New session created, you can switch to it by clicking the status bar." ) ;
8686 } 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 ) ;
8888 }
8989}
9090
0 commit comments