Skip to content

Commit df11f28

Browse files
authored
lsp-erlang: fix download URLs for erlang-language-platform (#4798)
ELP provides downloads in a matrix by OTP version (25.3, 26.2, 27.1) and base os, linux x86_64 and arm, macos x86 and arm Add a custom entry to choose the OTP version, and detect linux arm/x86 as already happening for macos. Tested on linux x86, report issues on other architectures
1 parent 199eaa9 commit df11f28

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

clients/lsp-erlang.el

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,18 +267,31 @@ Code Lenses. Only applies when `#elp.lens.enabled` and
267267
:group 'lsp-erlang-elp
268268
:package-version '(lsp-mode . "8.0.0"))
269269

270+
(defcustom lsp-erlang-elp-otp-download-version "27.1"
271+
"OTP version used as part of the file name when downlading the ELP binary.
272+
It must match those used in https://github.com/WhatsApp/erlang-language-platform/releases/latest"
273+
:type '(choice (string :tag "25.3")
274+
(string :tag "26.2")
275+
(string :tag "27.1"))
276+
:group 'lsp-erlang-elp
277+
:package-version '(lsp-mode . "8.0.0"))
278+
270279
(defcustom lsp-erlang-elp-download-url
271-
(format "https://github.com/WhatsApp/erlang-language-platform/releases/latest/download/%s"
280+
(format "https://github.com/WhatsApp/erlang-language-platform/releases/latest/download/elp-%s-otp-%s.tar.gz"
272281
(pcase system-type
273-
('gnu/linux "elp-linux-x86_64-unknown-linux-gnu-otp-26.tar.gz")
274-
('darwin
282+
('gnu/linux
275283
(if (string-match "^aarch64-.*" system-configuration)
276-
"elp-macos-aarch64-apple-darwin-otp-25.3.tar.gz"
277-
"elp-macos-x86_64-apple-darwin-otp-25.3.tar.gz"))))
278-
"Automatic download url for erlang-language-platform."
279-
:type 'string
280-
:group 'lsp-erlang-elp
281-
:package-version '(lsp-mode . "8.0.0"))
284+
"linux-aarch64-unknown-linux-gnu"
285+
"linux-x86_64-unknown-linux-gnu"))
286+
('darwin
287+
(if (string-match "^aarch64-.*" system-configuration)
288+
"macos-aarch64-apple-darwin"
289+
"macos-x86_64-apple-darwin")))
290+
lsp-erlang-elp-otp-download-version)
291+
"Automatic download url for erlang-language-platform."
292+
:type 'string
293+
:group 'lsp-erlang-elp
294+
:package-version '(lsp-mode . "8.0.0"))
282295

283296
(defcustom lsp-erlang-elp-store-path (f-join lsp-server-install-dir
284297
"erlang"

0 commit comments

Comments
 (0)