Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit f56af2e

Browse files
committed
Set project path as cwd for rls processes
This fixes some issues with latest nightly rls/cargo
1 parent a612af8 commit f56af2e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class RustLanguageClient extends AutoLanguageClient {
394394
!filePath.includes('/target/release/')
395395
}
396396

397-
startServerProcess() {
397+
startServerProcess(projectPath) {
398398
let cmdOverride = rlsCommandOverride()
399399
if (cmdOverride) {
400400
if (!this._warnedAboutRlsCommandOverride) {
@@ -404,15 +404,17 @@ class RustLanguageClient extends AutoLanguageClient {
404404
}
405405
return cp.spawn(cmdOverride, {
406406
env: serverEnv(),
407-
shell: true
407+
shell: true,
408+
cwd: projectPath
408409
})
409410
}
410411

411412
return checkToolchain(this.busySignalService)
412413
.then(toolchain => checkRls(this.busySignalService).then(() => toolchain))
413414
.then(toolchain => {
414415
return cp.spawn("rustup", ["run", configToolchain(), "rls"], {
415-
env: serverEnv(toolchain)
416+
env: serverEnv(toolchain),
417+
cwd: projectPath
416418
})
417419
})
418420
}

0 commit comments

Comments
 (0)