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

itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
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
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
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
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
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
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
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
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
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
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
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

We're in Beta

About us Mission Statement