Download right language server binary for OS (#8040)

Release Notes:

- Download right language server binary for OS
This commit is contained in:
bbb651 2024-02-19 23:53:03 -08:00 committed by GitHub
parent 3ef8a9910d
commit 4616d66e1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 63 additions and 17 deletions

View file

@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::{anyhow, bail, Result};
use async_compression::futures::bufread::GzipDecoder;
use async_trait::async_trait;
use futures::{io::BufReader, StreamExt};
@ -38,7 +38,13 @@ impl LspAdapter for RustLspAdapter {
delegate.http_client(),
)
.await?;
let asset_name = format!("rust-analyzer-{}-apple-darwin.gz", consts::ARCH);
let os = match consts::OS {
"macos" => "apple-darwin",
"linux" => "unknown-linux-gnu",
"windows" => "pc-windows-msvc",
other => bail!("Running on unsupported os: {other}"),
};
let asset_name = format!("rust-analyzer-{}-{os}.gz", consts::ARCH);
let asset = release
.assets
.iter()