abl63

abl63

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:

Showing Posts 1 to 10

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.

abl63

abl63 OP

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

abl63

abl63 OP

Hi Zachallaun, it worked for the most part, no major error. But it seems that there will be some issues since I don’t use the same OTP and Elixir versions as ElixirLS. Here is the output :

[Info  - 9:30:54 AM] Started ElixirLS v0.13.0
[Info  - 9:30:54 AM] ElixirLS built with elixir "1.12.3" on OTP "22"
[Info  - 9:30:54 AM] Running on elixir "1.14.4 (compiled with Erlang/OTP 25)" on OTP "25"
[Warn  - 9:30:54 AM] OTP compiled without EEP48 documentation chunks. Language features for erlang modules will run in limited mode. Please reinstall or rebuild OTP with approperiate flags.
[Info  - 9:30:54 AM] Elixir sources not found (checking in /home/build/elixir). Code navigation to Elixir modules disabled.
[Info  - 9:30:54 AM] Loaded DETS databases in 36ms
[Info  - 9:30:54 AM] Starting build with MIX_ENV: test MIX_TARGET: host
[Warn  - 9:30:54 AM] No mixfile found in project. To use a subdirectory, set `elixirLS.projectDir` in your settings. Looked for mixfile at "/root/myDev/elixir/mix.exs"
[Info  - 9:30:54 AM] Compile took 4 milliseconds
[Info  - 9:30:54 AM] [ElixirLS WorkspaceSymbols] Indexing...
[Info  - 9:30:54 AM] [ElixirLS WorkspaceSymbols] Module discovery complete
[Info  - 9:30:54 AM] [ElixirLS WorkspaceSymbols] 22 callbacks added to index
[Info  - 9:30:54 AM] [ElixirLS WorkspaceSymbols] 128 modules added to index
[Info  - 9:30:55 AM] [ElixirLS WorkspaceSymbols] 344 types added to index
[Info  - 9:30:56 AM] [ElixirLS WorkspaceSymbols] 3808 functions added to index

Since I am learning I don’t know yet about the mixfile. But with erlang modules in limited mode and code navigation to Elixir modules disabled, I guess that essential features won’t work.

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”.

outlog

outlog

0.14.2 is out now with a fix - working here™

abl63

abl63 OP

Thanks to you too for your answers.

I myself am very close to having everything working. But I still encounter an issue :

[Info  - 6:20:19 PM] Elixir sources not found (checking in /home/build/elixir). Code navigation to Elixir modules disabled.

I think I did everything correctly with asdf, following every step of the pugin instructions for Erlang and Elixir. But maybe I’m missing something… I saw that ElixirLS was designed to work with Elixir installed via asdf, so I wonder why it is trying to find Elixir in /home/build/elixir.

I saw here that someone cloned the Elixir repo on the previously mentioned path. But it seems a bit strange to have Elixir on my computer twice.

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).

abl63

abl63 OP

:clap: Thanks to you my journey through the winding and shady paths that lead to the configuration of a perfect environment is coming to an end! And I am in the best conditions to start the ascent of Mount Elixir. See you soon, companions.

03juan

03juan

Bon voyage :rocket: :mountain:

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).

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews