Fix gopls langserver downloads (#7571)
Fixes https://github.com/zed-industries/zed/issues/7534 by not requiring assets for gopls and vscode-eslint langservers — those two are the only ones in Zed that do not use assets directly when determining langserver version and retrieving those. All other servers deal with assets, hence require those to be present. The problem with https://github.com/tamasfe/taplo/releases is that they host multiple binary releases in the same release list, so for now the code works because only the langserver has assets — but as soon as another release there gets assets, it will break again. We could filter out those by names also, but they also tend to change (and can be edited manually), so keeping it as is for now. Release Notes: - Fixed gopls language server downloads ([7534](https://github.com/zed-industries/zed/issues/7534))
This commit is contained in:
parent
f734365b7b
commit
89b1e76003
13 changed files with 57 additions and 31 deletions
|
@ -976,7 +976,8 @@ async fn get_copilot_lsp(http: Arc<dyn HttpClient>) -> anyhow::Result<PathBuf> {
|
|||
|
||||
///Check for the latest copilot language server and download it if we haven't already
|
||||
async fn fetch_latest(http: Arc<dyn HttpClient>) -> anyhow::Result<PathBuf> {
|
||||
let release = latest_github_release("zed-industries/copilot", false, http.clone()).await?;
|
||||
let release =
|
||||
latest_github_release("zed-industries/copilot", true, false, http.clone()).await?;
|
||||
|
||||
let version_dir = &*paths::COPILOT_DIR.join(format!("copilot-{}", release.name));
|
||||
|
||||
|
@ -997,7 +998,7 @@ async fn get_copilot_lsp(http: Arc<dyn HttpClient>) -> anyhow::Result<PathBuf> {
|
|||
let mut response = http
|
||||
.get(url, Default::default(), true)
|
||||
.await
|
||||
.map_err(|err| anyhow!("error downloading copilot release: {}", err))?;
|
||||
.context("error downloading copilot release")?;
|
||||
let decompressed_bytes = GzipDecoder::new(BufReader::new(response.body_mut()));
|
||||
let archive = Archive::new(decompressed_bytes);
|
||||
archive.unpack(dist_dir).await?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue