xavaav

xavaav

Emacs Elixir lsp-mode broken

Hi All,

I’m not sure what happened but my Elixir LSP (in emacs) has stopped working ( I haven’t done anything to my .emacs file), it tries to restart with the error:

Server elixir-ls:2340/starting exited (check corresponding stderr buffer for details). Do you want to restart it? (y or n)

but then immediately stops working. I am using Elixir 1.16.0 and Erlang/OTP 26. Checking stderr per the recommendations I’m met with

Running /Users/canaan/.emacs.d/.cache/lsp/elixir-ls/launch.sh
Preffered shell is zsh, relaunching
Looking for ASDF install
ASDF not found
Looking for rtx executable
rtx not found
Installing ElixirLS release v0.16.0
Running in /Users/USER/Desktop/Workbench
Mix.install failed with ** (ArgumentError) unknown keys [:stop_started_applications] in [force: false, start_applications: false, stop_started_applications: false, consolidate_protocols: false], the allowed keys are: [:config, :config_path, :consolidate_protocols, :elixir, :force, :lockfile, :runtime_config, :start_applications, :system_env, :verbose]
    (elixir 1.16.0) lib/keyword.ex:359: Keyword.validate!/2
    (mix 1.16.0) lib/mix.ex:819: Mix.install/2
    /Users/USER/.emacs.d/.cache/lsp/elixir-ls/installer.exs:526: ElixirLS.Installer.install/1
    /Users/USER/.emacs.d/.cache/lsp/elixir-ls/installer.exs:543: ElixirLS.Installer.install_with_retry/0
    /Users/USER/.emacs.d/.cache/lsp/elixir-ls/quiet_install.exs:14: (file)
    (elixir 1.16.0) src/elixir_compiler.erl:67: :elixir_compiler.dispatch/4
    (elixir 1.16.0) src/elixir_compiler.erl:52: :elixir_compiler.compile/4
    (elixir 1.16.0) src/elixir_compiler.erl:39: :elixir_compiler.maybe_fast_compile/3

I appreciate if anyone has seen this error before and has any solutions. I’ve installed asdf, but it was working just fine before, is there some chance it’s a simple error and I’m not launching the server from the right directory? And if that is the case what is the simple fix?

Thanks again!

Marked As Solved

xavaav

xavaav

Hi All!

In case anyone find this and is stuck in the future, I’ve solved it for my particular case.

Instead of using the 'exec-path, moving the files from the latest lsp (18 in this case) to the ~/.emacs.d/.cache/lsp/elixir-ls/ solved the problem.

Just make sure to remove conflicting files. (I’m sure there is a more elegant way to do this, but this solves it).

Also Liked

tpdly

tpdly

I had the same problem, thanks for the solution.
Very strange that emacs insists on using the cache location. I tried deleting the .emacs.d/.cache/lsp/elixir-ls before, and somehow it just pulled the same thing from github into that cache folder-- some version 0.16 of elixir-ls. Good idea to just put an updated build there.

Where Next?

Popular in Questions Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
gazoon
I want to know absolute current module path. In python i could do that: os.path.abspath(__file__) Does elixir have anything similar?
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement