Skip to content

Commit ac50e35

Browse files
committed
Give better error message when the rust-analyzer binar path was set in the user's config but the binary is invalid
1 parent da89435 commit ac50e35

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

editors/code/src/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,12 @@ async function bootstrapServer(config: Config, state: PersistentState): Promise<
252252
log.info("Using server binary at", path);
253253

254254
if (!isValidExecutable(path)) {
255-
throw new Error(`Failed to execute ${path} --version`);
255+
if (config.serverPath) {
256+
throw new Error(`Failed to execute ${path} --version. \`config.server.path\` or \`config.serverPath\` has been set explicitly.\
257+
Consider removing this config or making a valid server binary available at that path.`);
258+
} else {
259+
throw new Error(`Failed to execute ${path} --version`);
260+
}
256261
}
257262

258263
return path;

0 commit comments

Comments
 (0)