dmur

dmur

ElixirLS extension for VSCode not starting on Ubuntu

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

Marked As Solved

gpopides

gpopides

Your versions are a bit off. You are using latest elixir (1.18) but your elixir-ls version is 0.13 which is almost 2 years old.

Elixir 1.18 is not yet supported by elixir ls as per crash with elixir 1.18 · Issue #1145 · elixir-lsp/elixir-ls · GitHub

You can either wait for the next version or use 1.17 with elixirls 0.25.0

Where Next?

Popular in Questions Top

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
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
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

TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
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
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement