abl63

abl63

ElixirLS (VSCode extension) installation issue on WSL2, Ubuntu

Hi everyone, I am new to Elixir and to programming in general. I am still setting things up to get working whith Elixir.

When installing ElixirLS extension in VSCode (running in Ubuntu WSL2, whith WSL extension installed), I have this output :

/root/.vscode-server/extensions/jakebecker.elixir-ls-0.14.0/elixir-ls-release/launch.sh: line 77:  5504 Killed                  elixir "$SCRIPTPATH/quiet_install.exs" > /dev/null 2> /dev/null < /dev/zero
[Error - 6:45:20 PM] Server initialization failed.
    Message: Pending response rejected since connection got disposed
    Code: -32097 
[Info  - 6:45:20 PM] Connection to server got closed. Server will restart.
true
[Error - 6:45:20 PM] ElixirLS - elixir client: couldn't create connection to server.
    Message: Pending response rejected since connection got disposed
    Code: -32097

Environment

  • Windows 11 → WSL2 → Ubuntu 22.04.2 LTS
  • VSCode whith WLS extension
  • Erlang/OTP 25 / Elixir 1.14.4 (installed using asdf, no problem using elixir or iex commands)

Troubleshooting

  • [tried] : Restart your editor (which will restats ElixirLS) sometimes fixes issues
  • [couldn’t find any directory] : Stop your editor, remove the entire .elixir_ls directory, then restart your editor

To be honest I don’t understand the output and what server is involved in the process of the installation. But I saw that people managed to install this extension on WSL2 without trouble here : VSCode - Elixir LS + WSL - #15 by robert

Thanks a lot if you have insights :pray:

Marked As Solved

zachallaun

zachallaun

I’m experiencing the same thing. I believe it’s a bug in the brand-new v0.14.0 release. I’d recommend reverting to v0.13.0 until it’s resolved, which will hopefully be soon.

Extension settings:

Click the down arrow next to Uninstall, then Install Another Version…

Select 0.13.0. May need to reload VSCode.

Also Liked

03juan

03juan

No need to clone it like that. The LS won’t link to precompiled asdf install, but you can tell asdf to build it for you.

Edit: Cached page as original no longer available: Fixing "Go to Definition" for Elixir's standard library | Random Developer's Blog (original: Fixing “Go To Definition” for Elixir’s standard library | Random Developer’s Blog )

It turns out asdf-elixir is using precompiled version when you execute asdf install elixir <version> which does not contain source code. However, if you take any commit reference (SHA string) from Elixir repo and use asdf install elixir ref:<commit_reference>, asdf will actually build it from the source to which that reference points. Each Elixir release is tagged so finding a commit reference for a correct version is pretty straightforward. After that, just as with normal asdf installation, you have to execute asdf global elixir ref:<commit_reference> to set that version as global.

After this is done, go to any project, delete .elixir_ls, deps and _build, run VSCode again and wait for the language server finish its job. Now, “Go to Definition” should work for everything (for the standard library it actually takes a couple of seconds; others should be instant).

outlog

outlog

0.14.2 is out now with a fix - working here™

mykulyak

mykulyak

Ah, I’d been having the same problem for several days …
Only reverting the ElixirLS plugin to 0.13.x helped. None of 0.14.x versions worked (I’m using VSCode on Mac M1).

abl63

abl63

I will try and let you know, thanks for answering and for the tip to change extension version :blush:

zachallaun

zachallaun

Ironically, Elixir/OTP mismatch issues was the big fix for 0.14.0 :slight_smile: IMO, don’t worry about it right now, move on without perfect language server integration, and check back in periodically to give it a try when you see a new release.

Another tip when ElixirLS is acting up: you can delete the .elixirls folder in the root of your project and run the VSCode command thats something like “ElixirLS: restart language server”.

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
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Kagamiiiii
Student &amp; New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
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
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
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
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
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
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

We're in Beta

About us Mission Statement