Skip to content

Commit

Permalink
Switch to a maintained fork ltex-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
vitallium committed Dec 5, 2024
1 parent 80f5b4f commit 3c18935
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# LTeX Language Server
# LTeX+ Language Server

[LTEX Language Server](https://github.com/valentjn/ltex-ls) support for Zed editor
[LTEX+ Language Server](https://ltex-plus.github.io/ltex-plus/) support for Zed editor.

## Configuration

See the [LTeX Language Server documentation](https://valentjn.github.io/ltex/settings.html) for more information on how to configure the LTeX Language Server.
See the [LTeX+ Language Server documentation](https://ltex-plus.github.io/ltex-plus/settings.html) for more information on how to configure the LTeX+ Language Server.

### Changing the language

Expand Down
2 changes: 1 addition & 1 deletion extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id = "ltex"
name = "ltex"
description = "LTEX Language Server support for Zed editor"
version = "0.0.3"
description = "LTEX+ Language Server support for Zed editor"
schema_version = 1
authors = ["Vitaly Slobodin <[email protected]>"]
repository = "https://github.com/vitallium/zed-ltex"
Expand Down
20 changes: 14 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl LtexExtension {
language_server_id: &LanguageServerId,
worktree: &zed::Worktree,
) -> Result<LtexBinary> {
if let Some(path) = worktree.which("ltex-ls") {
if let Some(path) = worktree.which("ltex-ls-plus") {
return Ok(LtexBinary {
path,
args: Some(vec![]),
Expand All @@ -40,23 +40,31 @@ impl LtexExtension {
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
);
let release = zed::latest_github_release(
"valentjn/ltex-ls",
"ltex-plus/ltex-ls-plus",
zed::GithubReleaseOptions {
require_assets: true,
pre_release: false,
},
)?;

let (platform, _arch) = zed::current_platform();
let (platform, arch) = zed::current_platform();
let version = release.version;

let asset_stem = format!(
"ltex-ls-{version}-{os}-x64",
"ltex-ls-plus-{version}-{os}-{arch}",
version = version,
os = match platform {
zed::Os::Mac => "mac",
zed::Os::Linux => "linux",
zed::Os::Windows => "windows",
},
arch = match arch {
zed::Architecture::Aarch64 => "aarch64",
zed::Architecture::X8664 => "x64",
zed::Architecture::X86 =>
return Err(
"The requested architecture x86 is not supported by `ltex-ls-plus`.".into()
),
}
);
let asset_name = format!(
Expand All @@ -73,8 +81,8 @@ impl LtexExtension {
.find(|asset| asset.name == asset_name)
.ok_or_else(|| format!("no asset found matching {:?}", asset_name))?;

let version_dir = format!("ltex-{}", version);
let binary_path = format!("{version_dir}/ltex-ls-{version}/bin/ltex-ls");
let version_dir = format!("ltex-ls-plus-{}", version);
let binary_path = format!("{version_dir}/{version_dir}/bin/ltex-ls-plus");

if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
zed::set_language_server_installation_status(
Expand Down

0 comments on commit 3c18935

Please sign in to comment.