@@ -20,7 +20,7 @@ class LeetCodeExecutor implements Disposable {
20
20
private configurationChangeListener : Disposable ;
21
21
22
22
constructor ( ) {
23
- this . leetCodeRootPath = path . join ( __dirname , ".." , ".." , "node_modules" , "vsc-leetcode-cli" ) ;
23
+ this . leetCodeRootPath = path . join ( __dirname , ".." , ".." , "node_modules" , "@haozibi" , " vsc-leetcode-cli") ;
24
24
this . nodeExecutable = this . getNodePath ( ) ;
25
25
this . configurationChangeListener = workspace . onDidChangeConfiguration ( ( event : ConfigurationChangeEvent ) => {
26
26
if ( event . affectsConfiguration ( "leetcode.nodePath" ) ) {
@@ -102,7 +102,7 @@ class LeetCodeExecutor implements Disposable {
102
102
103
103
public async showProblem ( problemNode : IProblem , language : string , filePath : string , showDescriptionInComment : boolean = false , needTranslation : boolean ) : Promise < void > {
104
104
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 ] ;
106
106
107
107
if ( ! needTranslation ) {
108
108
cmd . push ( "-T" ) ; // use -T to force English version
@@ -139,7 +139,7 @@ class LeetCodeExecutor implements Disposable {
139
139
}
140
140
141
141
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" ] ;
143
143
if ( ! needTranslation ) {
144
144
cmd . push ( "-T" ) ;
145
145
}
0 commit comments