Skip to content

Conversation

@samwdp
Copy link
Contributor

@samwdp samwdp commented Jun 21, 2025

Added odin language support though the ols server by Daniel Gavin
This will automatically install the server based on the nightly release provided by the repository and should work for all platforms. I have only been able to test on Windows but I have included the binary names for mac os (x86 and arm) and also the linux binary.

A user should install either odin-mode (this hasn't seen active development for the last 2 years and the maintainer seems to have abandoned it) or odin-ts-mode (still in development)

@github-actions github-actions bot added documentation client One or more of lsp-mode language clients labels Jun 21, 2025
@jcs090218
Copy link
Member

For the record, there is a fork from original odin-mode at https://git.sr.ht/~mgmarlow/odin-mode.

@jcs090218
Copy link
Member

Hmmm... I am not sure why the CI fails. 🤔

@samwdp
Copy link
Contributor Author

samwdp commented Jun 22, 2025

Hmmm... I am not sure why the CI fails. 🤔

Same, I haven't touched anything in the clangd server. And the 2 previous commits passed all the checks. When I make compile locally it is all fine but as I stated I'm on Windows. I just checked using wsl and it is also fine. I don't have an arm machine 🤔

@jcs090218
Copy link
Member

The problem is the f-join doesn't handle nil for you.

(defcustom lsp-odin-ols-binary-path
  (f-join lsp-odin-ols-server-install-dir "latest"
          ;; ERROR, this cond returns `nil'!
          (cond ((eq system-type 'windows-nt)
                 "ols-x86_64-pc-windows-msvc.exe")
                ((eq system-type 'darwin)
                 (if (string-match "aarch64-.*" system-configuration)
                     "ols-arm64-darwin"
                   "ols-x86_64-darwin"))
                ((and (eq system-type 'gnu/linux)
                      (or (eq (string-match "^x86_64" system-configuration) 0)
                          (eq (string-match "^i[3-6]86" system-configuration) 0)))
                 "ols-x86_64-unknown-linux-gnu")))
  "The path where ols binary after will be stored."
  :group 'lsp-odin-ols
  :type 'file)

The cond cannot be nil:

samwdp added 2 commits June 22, 2025 10:31
made the cond a pcase and gave a defulat of the linux versions
@samwdp
Copy link
Contributor Author

samwdp commented Jun 22, 2025

The problem is the f-join doesn't handle nil for you.

(defcustom lsp-odin-ols-binary-path
  (f-join lsp-odin-ols-server-install-dir "latest"
          ;; ERROR, this cond returns `nil'!
          (cond ((eq system-type 'windows-nt)
                 "ols-x86_64-pc-windows-msvc.exe")
                ((eq system-type 'darwin)
                 (if (string-match "aarch64-.*" system-configuration)
                     "ols-arm64-darwin"
                   "ols-x86_64-darwin"))
                ((and (eq system-type 'gnu/linux)
                      (or (eq (string-match "^x86_64" system-configuration) 0)
                          (eq (string-match "^i[3-6]86" system-configuration) 0)))
                 "ols-x86_64-unknown-linux-gnu")))
  "The path where ols binary after will be stored."
  :group 'lsp-odin-ols
  :type 'file)

The cond cannot be nil:

right, got it. I switched over to a pcase statement defaulting to the linux versions

@jcs090218
Copy link
Member

Awesome! Thank you for your cooperation! ;)

@jcs090218 jcs090218 merged commit 45ab3a8 into emacs-lsp:master Jun 22, 2025
18 checks passed
@samwdp samwdp deleted the odin-support branch July 20, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client One or more of lsp-mode language clients documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants