I am brand new to Elixir.
The ElixirLS extension doesn’t start for me in VSCode.
After I open VSCode in a project called “project” and load a .ex file, I get some flashed messages:
- ElixirLS - project client: couldn’t create connection to server.
- Pending response rejected since connection got disposed
- The ElixirLS - project server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
** (UndefinedFunctionError) function ElixirLS.LanguageServer.CLI.main/0 is undefined (module ElixirLS.LanguageServer.CLI is not available)
ElixirLS.LanguageServer.CLI.main()
nofile:1: (file)
(stdlib 6.1.2) erl_eval.erl:904: :erl_eval.do_apply/7
(elixir 1.18.0-dev) lib/code.ex:572: Code.validated_eval_string/3
[Error - 20:42:32] The ElixirLS - aoc24 server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 20:42:32] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 20:42:32] ElixirLS - aoc24 client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 20:42:32] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
My symptoms are almost identical to this thread from 2023: ElixirLS (VSCode extension) installation issue on WSL2, Ubuntu
The solution in that case was to downgrade from ElixirLS 0.14.0 to 0.13.0. However, I’m already on 0.13.0, and in fact, that is the most recent version available for me through the VSCode Extension installer.
I have elixir installed through asdf. “elixir”, “mix”, and “iex” all work fine. I think I have “hex” installed too: the output of “mix local.hex” is
Found existing entry: /home/david/.asdf/installs/elixir/main/.mix/archives/hex-2.1.1
Are you sure you want to replace it with "https://builds.hex.pm/installs/1.16.0/hex-2.1.1.ez"? [Yn]
I am running Ubuntu 22.04.
* Elixir & Erlang versions (elixir --version): Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
Elixir 1.18.0-dev (d97b29f) (compiled with Erlang/OTP 25)
* VSCode ElixirLS version: 0.13.0
* Operating System Version: linux 6.8.0-49-generic