Parse version from GitHub tag name instead of release name (#7423)

If we not change this, some release will parse error.

https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28

```json
{
  "name": {
    "type": [
      "string",
      "null"
    ]
  }
}
```

<img width="1188" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/bd53dbc4-ae2c-4f19-afd7-58e70b4f87d8">

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Jason Lee 2024-02-09 04:28:51 +08:00 committed by GitHub
parent bde509fa74
commit e7fcddff69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 23 additions and 27 deletions

View file

@ -42,7 +42,7 @@ impl super::LspAdapter for LuaLspAdapter {
delegate.http_client(),
)
.await?;
let version = &release.name;
let version = &release.tag_name;
let asset_name = format!("lua-language-server-{version}-darwin-{platform}.tar.gz");
let asset = release
.assets
@ -50,7 +50,7 @@ impl super::LspAdapter for LuaLspAdapter {
.find(|asset| asset.name == asset_name)
.ok_or_else(|| anyhow!("no asset found matching {:?}", asset_name))?;
let version = GitHubLspBinaryVersion {
name: release.name,
name: release.tag_name,
url: asset.browser_download_url.clone(),
};
Ok(Box::new(version) as Box<_>)