Elixir-ls error: {:error, already_present}


I am attempting to use the elixir-ls for neovim. I get this error when the language server is trying to start up:

[WARN][2023-06-04 16:07:54] ...lsp/handlers.lua:537	"** (MatchError) no match of right hand side value: {:error, :already_present}\n    lib/language_server/cli.ex:20: ElixirLS.LanguageServer.CLI.main/0\n    nofile:1: (file)\n    (stdlib erl_eval.erl:748: :erl_eval.do_apply/7\n    (elixir 1.15.0-rc.1) lib/code.ex:543: Code.validated_eval_string/3"

I am using:
Elixir 1.15.0-rc.0 (3cdb388) (compiled with Erlang/OTP 24)
Erlang/OTP 24 [erts-] [source] [64-bit] [smp:16:16] [ds:16:16:10]

I have tried using OTP 25 and I got the same issue.

This is the match that fails in cli.ex:

    {:ok, _} = Logger.add_backend(Logger.Backends.JsonRpc)

I’m not very savvy with language servers or elixir, and can’t work out why this is occuring. I thought maybe it’s because there shouldn’t be multiple servers up at the same time but when I load up ubuntu fresh and run language_server.sh from bash I get the same error.

Any ideas?



My bad, I installed all of the dependencies listed on the asdf erlang repo and then the ls started working.

Elixir 1.15 is not yet supported by elixirLS. We generally do not support not released versions. Please use 1.14 or wait for a next release

1 Like

Do we need to wait for a full release of 1.15 before using this fix? Race conditions in SourceFile.formatter_opts · Issue #402 · elixir-lsp/elixir-ls · GitHub