Skip to content

Commit

Permalink
Use tagged language server releases
Browse files Browse the repository at this point in the history
  • Loading branch information
someone13574 committed Oct 30, 2024
1 parent 84d7fea commit 9d71a18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/language_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use zed_extension_api::{self as zed};
pub trait LanguageServer {
const LANGUAGE_SERVER_ID: &'static str;
const DOWNLOAD_REPO: &'static str;
const DOWNLOAD_TAG: &'static str;

fn binary_name(os: zed::Os) -> String;
fn binary_path(version: &str, os: zed::Os, arch: zed::Architecture) -> zed::Result<String>;
Expand Down
9 changes: 2 additions & 7 deletions src/language_server/verible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub struct Verible {
impl LanguageServer for Verible {
const LANGUAGE_SERVER_ID: &'static str = "verible";
const DOWNLOAD_REPO: &'static str = "chipsalliance/verible";
const DOWNLOAD_TAG: &'static str = "v0.0-3836-g86ee9bab";

fn binary_name(os: zed::Os) -> String {
match os {
Expand Down Expand Up @@ -59,13 +60,7 @@ impl LanguageServer for Verible {
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
);

let release = zed::latest_github_release(
Self::DOWNLOAD_REPO,
zed::GithubReleaseOptions {
require_assets: true,
pre_release: false,
},
)?;
let release = zed::github_release_by_tag_name(Self::DOWNLOAD_REPO, Self::DOWNLOAD_TAG)?;

let asset_name = Self::asset_name(&release.version, os, arch)?;
let asset = release
Expand Down
9 changes: 2 additions & 7 deletions src/language_server/veridian.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub struct Veridian {
impl LanguageServer for Veridian {
const LANGUAGE_SERVER_ID: &'static str = "veridian";
const DOWNLOAD_REPO: &'static str = "someone13574/zed-verilog-extension";
const DOWNLOAD_TAG: &'static str = "v0.0.4";

fn binary_name(os: zed_extension_api::Os) -> String {
match os {
Expand Down Expand Up @@ -56,13 +57,7 @@ impl LanguageServer for Veridian {
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
);

let release = zed::latest_github_release(
Self::DOWNLOAD_REPO,
zed::GithubReleaseOptions {
require_assets: true,
pre_release: false,
},
)?;
let release = zed::github_release_by_tag_name(Self::DOWNLOAD_REPO, Self::DOWNLOAD_TAG)?;

let asset_name = Self::asset_name(&release.version, os, arch)?;
let asset = release
Expand Down

0 comments on commit 9d71a18

Please sign in to comment.