mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-08 18:41:48 +00:00
Handle new elixir-ls release zip name
This commit is contained in:
parent
dddff644ca
commit
1882ce48be
1 changed files with 12 additions and 5 deletions
|
@ -62,16 +62,23 @@ impl LspAdapter for ElixirLspAdapter {
|
||||||
&self,
|
&self,
|
||||||
delegate: &dyn LspAdapterDelegate,
|
delegate: &dyn LspAdapterDelegate,
|
||||||
) -> Result<Box<dyn 'static + Send + Any>> {
|
) -> Result<Box<dyn 'static + Send + Any>> {
|
||||||
let release =
|
let http = delegate.http_client();
|
||||||
latest_github_release("elixir-lsp/elixir-ls", false, delegate.http_client()).await?;
|
let release = latest_github_release("elixir-lsp/elixir-ls", false, http).await?;
|
||||||
let asset_name = "elixir-ls.zip";
|
let version_name = release
|
||||||
|
.name
|
||||||
|
.strip_prefix("Release ")
|
||||||
|
.context("Elixir-ls release name does not start with prefix")?
|
||||||
|
.to_owned();
|
||||||
|
|
||||||
|
let asset_name = format!("elixir-ls-{}.zip", &version_name);
|
||||||
let asset = release
|
let asset = release
|
||||||
.assets
|
.assets
|
||||||
.iter()
|
.iter()
|
||||||
.find(|asset| asset.name == asset_name)
|
.find(|asset| asset.name == asset_name)
|
||||||
.ok_or_else(|| anyhow!("no asset found matching {:?}", asset_name))?;
|
.ok_or_else(|| anyhow!("no asset found matching {:?}", asset_name))?;
|
||||||
|
|
||||||
let version = GitHubLspBinaryVersion {
|
let version = GitHubLspBinaryVersion {
|
||||||
name: release.name,
|
name: version_name,
|
||||||
url: asset.browser_download_url.clone(),
|
url: asset.browser_download_url.clone(),
|
||||||
};
|
};
|
||||||
Ok(Box::new(version) as Box<_>)
|
Ok(Box::new(version) as Box<_>)
|
||||||
|
@ -116,7 +123,7 @@ impl LspAdapter for ElixirLspAdapter {
|
||||||
.await?
|
.await?
|
||||||
.status;
|
.status;
|
||||||
if !unzip_status.success() {
|
if !unzip_status.success() {
|
||||||
Err(anyhow!("failed to unzip clangd archive"))?;
|
Err(anyhow!("failed to unzip elixir-ls archive"))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_matching(&container_dir, |entry| entry != version_dir).await;
|
remove_matching(&container_dir, |entry| entry != version_dir).await;
|
||||||
|
|
Loading…
Reference in a new issue