Skip to content

Commit 0753bb0

Browse files
authored
Add architecture-specific config selection for JDTLS (#249)
1 parent 104baab commit 0753bb0

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/jdtls.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::{
66

77
use sha1::{Digest, Sha1};
88
use zed_extension_api::{
9-
self as zed, DownloadedFileType, LanguageServerId, LanguageServerInstallationStatus, Os,
10-
Worktree, current_platform, download_file,
9+
self as zed, Architecture, DownloadedFileType, LanguageServerId,
10+
LanguageServerInstallationStatus, Os, Worktree, current_platform, download_file,
1111
http_client::{HttpMethod, HttpRequest, fetch},
1212
make_file_executable,
1313
serde_json::Value,
@@ -428,12 +428,12 @@ fn get_sha1_hex(input: &str) -> String {
428428
}
429429

430430
fn get_shared_config_path(jdtls_base_directory: &Path) -> PathBuf {
431-
// Note: JDTLS also provides config_linux_arm and config_mac_arm (and others),
432-
// but does not use them in their own launch script. It may be worth investigating if we should use them when appropriate.
433-
let config_to_use = match current_platform().0 {
434-
Os::Linux => "config_linux",
435-
Os::Mac => "config_mac",
436-
Os::Windows => "config_win",
431+
let config_to_use = match current_platform() {
432+
(Os::Mac, Architecture::Aarch64) => "config_mac_arm",
433+
(Os::Mac, _) => "config_mac",
434+
(Os::Linux, Architecture::Aarch64) => "config_linux_arm",
435+
(Os::Linux, _) => "config_linux",
436+
(Os::Windows, _) => "config_win",
437437
};
438438
jdtls_base_directory.join(config_to_use)
439439
}

0 commit comments

Comments
 (0)