Skip to content

Commit 49acafc

Browse files
authored
fix: Ols server download url getting malformed (#4841)
* fix: ols download url malformed f-join stripping `//` from url. Using format instead * fixed copy paste
1 parent 3e08947 commit 49acafc

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

CHANGELOG.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* Add support for [[https://github.com/tombi-toml/tombi][Tombi language server]] (TOML language).
4343
* Make lsp-headerline--check-breadcrumb public
4444
* Added Odin langauge server support [[https://github.com/DanielGavin/ols][ols]]
45+
* Fix bug in lsp-odin where ~f-join~ collapses double slashes. Using ~format~ instead.
4546

4647
** 9.0.0
4748
* Add language server config for QML (Qt Modeling Language) using qmlls.

clients/lsp-odin.el

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,19 @@
3333
:link '(url-link "https://github.com/DanielGavin/ols")
3434
:package-version '(lsp-mode . "9.0.0"))
3535

36+
3637
(defcustom lsp-odin-ols-download-url
37-
(let ((suffix
38-
(pcase system-type
39-
('windows-nt
40-
(when (and (string-match "^x86_64-.*" system-configuration)
41-
(version<= "26.4" emacs-version))
42-
"ols-x86_64-pc-windows-msvc.zip"))
43-
('darwin
44-
(if (string-match "aarch64-.*" system-configuration)
45-
"ols-arm64-darwin.zip"
46-
"ols-x86_64-darwin.zip"))
47-
(_
48-
"ols-x86_64-unknown-linux-gnu"))))
49-
(when suffix
50-
(f-join "https://github.com/DanielGavin/ols/releases/download/nightly/"
51-
suffix)))
38+
(let* ((x86 (string-prefix-p "x86_64" system-configuration))
39+
(arch (if x86 "x86_64" "arm64")))
40+
(format "https://github.com/DanielGavin/ols/releases/download/nightly/%s"
41+
(pcase system-type
42+
('gnu/linux (format "ols-%s-unknown-linux-gnu.zip" arch))
43+
('darwin (format "ols-%s-darwin.zip" arch))
44+
('windows-nt (format "ols-%s-pc-windows-msvc.zip" arch)))))
5245
"Automatic download url for ols language server."
46+
:type 'string
5347
:group 'lsp-odin-ols
54-
:type 'string)
48+
:package-version '(lsp-mode . "9.0.0"))
5549

5650
(defcustom lsp-odin-ols-server-install-dir
5751
(f-join lsp-server-install-dir "ols/")

0 commit comments

Comments
 (0)