aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-22 16:38:12 +0000
committerGitHub <[email protected]>2020-12-22 16:38:12 +0000
commit94f661c62a41674d9ee04c2f3cd030d639acc926 (patch)
tree6afdb5092c00a4d2b3ee007fa64034d12c71d83c /editors/code/src
parentb28322eed6b977eb566444e8edbb229f4f610cd6 (diff)
parent5ff576f503889a0013f8e2eeac103312909cf66f (diff)
Merge #7001
7001: Add support for downloading aarch64-apple-darwin binaries r=matklad a=lnicola There's also a slight behavior change here: we no longer download our 64-binaries on 32-bit Darwin and Linux. We still do that on Windows, as I don't know how to detect 32-bit Node on 64 Windows. But some people install the 32-bit Code by mistake, I doubt 32-bit Windows is that popular in the Rust crowd. Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/main.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 83d0bdf12..282240d84 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -287,12 +287,14 @@ async function getServer(config: Config, state: PersistentState): Promise<string
287 if (config.package.releaseTag === null) return "rust-analyzer"; 287 if (config.package.releaseTag === null) return "rust-analyzer";
288 288
289 let platform: string | undefined; 289 let platform: string | undefined;
290 if (process.arch === "x64" || process.arch === "ia32") { 290 if ((process.arch === "x64" || process.arch === "ia32") && process.platform === "win32") {
291 if (process.platform === "linux") platform = "linux"; 291 platform = "x86_64-pc-windows-msvc";
292 if (process.platform === "darwin") platform = "mac"; 292 } else if (process.arch === "x64" && process.platform === "linux") {
293 if (process.platform === "win32") platform = "windows"; 293 platform = "x86_64-unknown-linux-gnu";
294 } else if (process.arch === "x64" && process.platform === "darwin") {
295 platform = "x86_64-apple-darwin";
294 } else if (process.arch === "arm64" && process.platform === "darwin") { 296 } else if (process.arch === "arm64" && process.platform === "darwin") {
295 platform = "mac"; 297 platform = "aarch64-apple-darwin";
296 } 298 }
297 if (platform === undefined) { 299 if (platform === undefined) {
298 vscode.window.showErrorMessage( 300 vscode.window.showErrorMessage(
@@ -305,7 +307,7 @@ async function getServer(config: Config, state: PersistentState): Promise<string
305 ); 307 );
306 return undefined; 308 return undefined;
307 } 309 }
308 const ext = platform === "windows" ? ".exe" : ""; 310 const ext = platform.indexOf("-windows-") !== -1 ? ".exe" : "";
309 const dest = path.join(config.globalStoragePath, `rust-analyzer-${platform}${ext}`); 311 const dest = path.join(config.globalStoragePath, `rust-analyzer-${platform}${ext}`);
310 const exists = await fs.stat(dest).then(() => true, () => false); 312 const exists = await fs.stat(dest).then(() => true, () => false);
311 if (!exists) { 313 if (!exists) {