diff --git a/crates/languages/src/c.rs b/crates/languages/src/c.rs index bad4e0a076..28ceedf7ad 100644 --- a/crates/languages/src/c.rs +++ b/crates/languages/src/c.rs @@ -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> { 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()