File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,15 @@ export function resolveBinary() {
4040}
4141
4242export async function testBinaryExist ( command : string ) {
43+ const uris = workspace . workspaceFolders ?. map ( i => i . uri ?. fsPath ) ?? [ ]
4344 return new Promise ( r => {
4445 execFile (
4546 command ,
4647 [ '-h' ] ,
4748 {
4849 // for windows
4950 shell : process . platform === 'win32' ,
51+ cwd : uris [ 0 ] ,
5052 } ,
5153 err => {
5254 r ( ! err )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const languageClientId = 'ast-grep-client'
1414const languageClientName = 'ast-grep language client'
1515
1616function getExecutable ( isDebug : boolean ) : Executable {
17+ const uris = workspace . workspaceFolders ?. map ( i => i . uri ?. fsPath ) ?? [ ]
1718 const command = resolveBinary ( )
1819 return {
1920 command,
@@ -25,6 +26,7 @@ function getExecutable(isDebug: boolean): Executable {
2526 } ,
2627 // shell is required for Windows cmd to pick up global npm binary
2728 shell : process . platform === 'win32' ,
29+ cwd : uris [ 0 ] ,
2830 } ,
2931 }
3032}
You can’t perform that action at this time.
0 commit comments