asdf-elixir icon indicating copy to clipboard operation
asdf-elixir copied to clipboard

Compiled elixir modules have the wrong path for source

Open albertored opened this issue 2 years ago • 0 comments

When installing a precompiled version of elixir with asdf you get also the source code but compiled modules have the wrong path for it in their compile metadata.

iex> Enum.__info__(:compile)[:source]
'/home/build/elixir/lib/elixir/lib/enum.ex'

The correct path is ~/.asdf/installs/elixir/1.14.1/lib/elixir/lib/enum.ex. I have not tried building from source but I think it that case it's working.

The wrong source path causes, for instance, ElixirLS not being able to navigate to Elixir source code

[Info  - 9:17:22 AM] Started ElixirLS v0.13.0
[Info  - 9:17:22 AM] ElixirLS built with elixir "1.12.3" on OTP "22"
[Info  - 9:17:22 AM] Running on elixir "1.13.4 (compiled with Erlang/OTP 24)" on OTP "24"
[Info  - 9:17:22 AM] Elixir sources not found (checking in /home/build/elixir). Code navigation to Elixir modules disabled.

albertored avatar Jan 25 '23 08:01 albertored