diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2020-12-22 16:46:01 +0200 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2020-12-22 16:48:49 +0200 |
| commit | 5ff576f503889a0013f8e2eeac103312909cf66f (patch) | |
| tree | be16583f4b8e1fa5f1c724210d476dd0ccdf7ed1 /editors/code/src | |
| parent | e1acb0ca5ca2162be068fd6a07f7cc4ae171ed81 (diff) | |
| download | rust-5ff576f503889a0013f8e2eeac103312909cf66f.tar.gz rust-5ff576f503889a0013f8e2eeac103312909cf66f.zip | |
Add support for downloading aarch64-apple-darwin binaries, change naming convention
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/main.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 4b2d3c8a557..e7d184cb39a 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 if (config.package.releaseTag === null) return "rust-analyzer"; let platform: string | undefined; - if (process.arch === "x64" || process.arch === "ia32") { - if (process.platform === "linux") platform = "linux"; - if (process.platform === "darwin") platform = "mac"; - if (process.platform === "win32") platform = "windows"; + if ((process.arch === "x64" || process.arch === "ia32") && process.platform === "win32") { + platform = "x86_64-pc-windows-msvc"; + } else if (process.arch === "x64" && process.platform === "linux") { + platform = "x86_64-unknown-linux-gnu"; + } else if (process.arch === "x64" && process.platform === "darwin") { + platform = "x86_64-apple-darwin"; } else if (process.arch === "arm64" && process.platform === "darwin") { - platform = "mac"; + platform = "aarch64-apple-darwin"; } if (platform === undefined) { vscode.window.showErrorMessage( @@ -305,7 +307,7 @@ async function getServer(config: Config, state: PersistentState): Promise<string ); return undefined; } - const ext = platform === "windows" ? ".exe" : ""; + const ext = platform.indexOf("-windows-") !== -1 ? ".exe" : ""; const dest = path.join(config.globalStoragePath, `rust-analyzer-${platform}${ext}`); const exists = await fs.stat(dest).then(() => true, () => false); if (!exists) { |
