about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-01-20 22:17:08 +0000
committerbors <bors@rust-lang.org>2023-01-20 22:17:08 +0000
commit9a6294d7038e7eab00beafdf64ec4aa50a4c66a2 (patch)
treeff214f6792638dde1cf810fd13562c6bd74e14fb
parent303737dad78406e5531cb23c5b6e83bc6c6d56fe (diff)
parent7198cd04ac14a31fc9e401e6a4e411e401acc326 (diff)
downloadrust-9a6294d7038e7eab00beafdf64ec4aa50a4c66a2.tar.gz
rust-9a6294d7038e7eab00beafdf64ec4aa50a4c66a2.zip
Auto merge of #13993 - OmarTawfik-forks:fix-server-path, r=Veykril
fix: substitute vscode variables in `config.serverPath`

From comment by `@Veykril` in https://github.com/rust-lang/rust-analyzer/issues/13939#issuecomment-1398187320:

> Yep, we pull the server path first, then substitute the configs, that's the wrong order.

https://github.com/rust-lang/rust-analyzer/blob/6e52c64031825920983515b9e975e93232739f7f/editors/code/src/ctx.ts#L155-L161

Fixes #13939
-rw-r--r--editors/code/src/bootstrap.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/code/src/bootstrap.ts b/editors/code/src/bootstrap.ts
index 374c3b8144c..cabc7407172 100644
--- a/editors/code/src/bootstrap.ts
+++ b/editors/code/src/bootstrap.ts
@@ -1,6 +1,6 @@
 import * as vscode from "vscode";
 import * as os from "os";
-import { Config } from "./config";
+import { Config, substituteVSCodeVariables } from "./config";
 import { log, isValidExecutable } from "./util";
 import { PersistentState } from "./persistent_state";
 import { exec } from "child_process";
@@ -132,7 +132,7 @@ async function getServer(
     return undefined;
 }
 function serverPath(config: Config): string | null {
-    return process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath;
+    return process.env.__RA_LSP_SERVER_DEBUG ?? substituteVSCodeVariables(config.serverPath);
 }
 
 async function isNixOs(): Promise<boolean> {