clangd: download the correct binary on Linux (#8820)

Release Notes:

- Fixed clangd LSP download not working on Linux
This commit is contained in:
Thorben Kröger 2024-03-04 15:58:58 +01:00 committed by GitHub
parent 98a1e87fbe
commit 94593dca4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,10 +1,10 @@
use anyhow::{anyhow, Context, Result};
use anyhow::{anyhow, bail, Context, Result};
use async_trait::async_trait;
use futures::StreamExt;
pub use language::*;
use lsp::LanguageServerBinary;
use smol::fs::{self, File};
use std::{any::Any, path::PathBuf, sync::Arc};
use std::{any::Any, env::consts, path::PathBuf, sync::Arc};
use util::{
async_maybe,
fs::remove_matching,
@ -26,7 +26,12 @@ impl super::LspAdapter for CLspAdapter {
) -> Result<Box<dyn 'static + Send + Any>> {
let release =
latest_github_release("clangd/clangd", true, false, delegate.http_client()).await?;
let asset_name = format!("clangd-mac-{}.zip", release.tag_name);
let os_suffix = match consts::OS {
"macos" => "mac",
"linux" => "linux",
other => bail!("Running on unsupported os: {other}"),
};
let asset_name = format!("clangd-{}-{}.zip", os_suffix, release.tag_name);
let asset = release
.assets
.iter()