@@ -20,7 +20,7 @@ class LeetCodeExecutor implements Disposable {
2020 private configurationChangeListener : Disposable ;
2121
2222 constructor ( ) {
23- this . leetCodeRootPath = path . join ( __dirname , ".." , ".." , "node_modules" , "vsc-leetcode-cli" ) ;
23+ this . leetCodeRootPath = path . join ( __dirname , ".." , ".." , "node_modules" , "@haozibi" , " vsc-leetcode-cli") ;
2424 this . nodeExecutable = this . getNodePath ( ) ;
2525 this . configurationChangeListener = workspace . onDidChangeConfiguration ( ( event : ConfigurationChangeEvent ) => {
2626 if ( event . affectsConfiguration ( "leetcode.nodePath" ) ) {
@@ -102,7 +102,7 @@ class LeetCodeExecutor implements Disposable {
102102
103103 public async showProblem ( problemNode : IProblem , language : string , filePath : string , showDescriptionInComment : boolean = false , needTranslation : boolean ) : Promise < void > {
104104 const templateType : string = showDescriptionInComment ? "-cx" : "-c" ;
105- const cmd : string [ ] = [ await this . getLeetCodeBinaryPath ( ) , "show" , problemNode . id , templateType , "-l" , language ] ;
105+ const cmd : string [ ] = [ await this . getLeetCodeBinaryPath ( ) , "show" , "'" + problemNode . id + "'" , templateType , "-l" , language ] ;
106106
107107 if ( ! needTranslation ) {
108108 cmd . push ( "-T" ) ; // use -T to force English version
@@ -139,7 +139,7 @@ class LeetCodeExecutor implements Disposable {
139139 }
140140
141141 public async getDescription ( problemNodeId : string , needTranslation : boolean ) : Promise < string > {
142- const cmd : string [ ] = [ await this . getLeetCodeBinaryPath ( ) , "show" , problemNodeId , "-x" ] ;
142+ const cmd : string [ ] = [ await this . getLeetCodeBinaryPath ( ) , "show" , "'" + problemNodeId + "'" , "-x" ] ;
143143 if ( ! needTranslation ) {
144144 cmd . push ( "-T" ) ;
145145 }
0 commit comments