victorolinasc

victorolinasc

Has anyone tried the emacs lsp-mode + elixir-ls?

I’ve noticed that the emacs support is starting to get behind other editors. Actually, alchemist and elixir-mode are really nice, but they are lagging behind in terms of evolution. Several issues without answer and no new releases for a while.

I started to take a look at alternatives and I really like the idea of a Language Server for Elixir (and Erlang). Elixir-ls works nicely with Visual Studio Code and I wonder if it would work with emacs-lsp but Haven found the time to try it yet.

So, has anyone tried this combination with luck? I really think all efforts on IDE/text editors support should focus on language server now. We would all have a very similar experience with our prefered keybindings and plugins…

Showing Posts 1 to 10

karmajunkie

karmajunkie

Definitely agree—I use spacemacs daily but know just enough elisp to be dangerous… literally. Trying get mix format to format my code on save i managed to get my emacs into a situation where I literally could not close it short of a force kill. Don’t ask me how, I have no idea.

So the moral of the story is that I’m at the tender mercies of those brave souls who forge a path for us mortals to tread. I wish I could help move integrations like alchemist forward, but seriously, I’m a danger to others. I’m going to check out this lsp-mode and pray I don’t manage set off a WarGames situation. Will report back if I’m successful, but don’t wait too long to send out search parties.

rodrigues

rodrigues

Seems an interesting path to move into!

My elisp is also potentially dangerous heheh, I’ve been using emacs for a couple of months only, so I can only do the basic stuff… but gonna play a bit with it, at least take a look at what they did for the other languages :+1:

@karmajunkie on the mix format issue, I’m using GitHub - anildigital/mix-format.el: Emacs package to format Elixir code in Emacs with elixir-mode · GitHub, so far no problems with it!

victorolinasc

victorolinasc OP

I am using mix-format too, though it is a bit slower on Emacs than on VS Code. The issue is that it is not on Melpa yet so I`ve copied it to my config.

Also, the creator of mix-format is interested in merging it into elixir-mode itself. Though it seems it is blocked currently because there is a shortage of elisp reviewers =/

rodrigues

rodrigues

Was trying to hack my way through this, but it still doesn’t work. Here is the wip as for now: https://gist.github.com/rodrigues/a7277c70ab9be361390fa52f923e7e03

karmajunkie

karmajunkie

Any luck with that approach?

edmz

edmz

BTW, Spacemacs just added LSP support. Maybe you can see what they did there to make it work.

JakeBecker

JakeBecker

I’ve just gotten around to publishing a precompiled release package which includes .sh and .bat scripts for launching the language server and debugger: Releases · JakeBecker/elixir-ls · GitHub

I’m hoping this makes it easier to integrate into IDE plugins. Hope that helps @rodrigues and everyone!

rodrigues

rodrigues

It’s definitely still in progress, but now it’s talking to elixir-ls behind the scenes!! https://gist.github.com/rodrigues/a7277c70ab9be361390fa52f923e7e03 :cowboy_hat_face:

Thanks @JakeBecker, the releases really helped!

EDIT: moved it into a github repo. PRs are more than welcome!

https://github.com/rodrigues/lsp-elixir

erikbye

erikbye

I’m using Alchemist with elixir-ls.

https://github.com/tonini/alchemist.el/pull/341

victorolinasc

victorolinasc OP

I’ve managed to get elixir-ls through alchemist working too. Here is my configuration just in case anyone would want to give it a try:

First, I’ve cloned @Trevoke’s for on ~/.alchemist. Then on my init.el (with use-package already configured), I have:

(use-package company
  :ensure t
  :diminish company-mode
  :bind ("M-/" . company-complete)
  :defer t
  :config
  (global-company-mode))

 (use-package company-quickhelp
  :after (company)
  :ensure t
  :config
  (company-quickhelp-mode))

(use-package lsp-mode
  :ensure t)

(use-package lsp-ui
  :after (lsp-mode)
  :ensure t)

(use-package company-lsp
  :after (company lsp-mode)
  :config
  (push 'company-lsp company-backends)
  :ensure t)

(use-package alchemist
  :after (elixir-mode)
  :load-path "../.alchemist"
  :config
  (require 'alchemist-elixir-ls)
  (require 'alchemist-goto)
  (require 'alchemist))

Hope this helps!

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New
dillonoconnor
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews