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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews