victorolinasc
Emacs lsp-mode (language server) + elixir-ls anyone?
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…
Most Liked
rodrigues
It’s definitely still in progress, but now it’s talking to elixir-ls behind the scenes!! https://gist.github.com/rodrigues/a7277c70ab9be361390fa52f923e7e03 ![]()
Thanks @JakeBecker, the releases really helped!
EDIT: moved it into a github repo. PRs are more than welcome!
victorolinasc
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!
edmz
BTW, Spacemacs just added LSP support. Maybe you can see what they did there to make it work.
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!
Trevoke
Hi all,
Thanks for the interest!
Yeah, this is not yet ready for spacemacs, unfortunately. I originally thought I could do a back-end refactor of alchemist and get rid of all the original code, using only elixir-ls, but it turns out that alchemist does a lot of things that need to be implemented in the LSP server, so I’m going to do the refactor much more incrementally.
I’m looking forward to collaborating with the community on the growth of elixir_sense (the Elixir code analyzer), elixir-ls (the Elixir LSP server) and alchemist (the emacs client).
I’ve started forks of the back-end components ( Elixir Language Server Protocol · GitHub ) because I had a very hard time getting in touch with the maintainers – and because I think this stuff should belong to the community, not a single person.









