Skip to content
This repository was archived by the owner on Dec 8, 2020. It is now read-only.

Commit 20f48b7

Browse files
authored
Fix "rust.rls.args", "rust.rls.env" (#291)
* Consider "rust.rls.executable" when determining args * Fix "rust.rls.env"
1 parent f55d6fb commit 20f48b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/configuration/RlsConfiguration.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export class RlsConfiguration {
4444
* Returns arguments for RLS
4545
*/
4646
public getArgs(): string[] {
47-
if (this._rustup && this._rustup.isRlsInstalled()) {
47+
// When the user specifies some executable path, the user expects the extension not to add
48+
// some arguments
49+
if (this._executableUserPath === undefined && this._rustup && this._rustup.isRlsInstalled()) {
4850
return ['run', 'nightly', 'rls'].concat(this._userArgs);
4951
} else {
5052
return this._userArgs;
@@ -55,7 +57,7 @@ export class RlsConfiguration {
5557
* Returns environment to run RLS in
5658
*/
5759
public getEnv(): object {
58-
const env = Object.create(this._userEnv);
60+
const env: any = Object.assign({}, this._userEnv);
5961
if (!env.RUST_SRC_PATH) {
6062
const rustSourcePath = this._rustSource.getPath();
6163
if (rustSourcePath) {

0 commit comments

Comments
 (0)