janp

janp

ElixirLS cannot find Elixir sources (ASDF, pre-compiled Elixir)

I can’t believe I am the only one having this issue, but I wasn’t able to find a solution :confused:

I used ASDF to install Elixir and Erlang and now I added vim-lsp and vim-lsp-settings to use ElixirLS, but when starting ElixirLS, I get an error that it could not find the elixir sources:

{
  "jsonrpc":"2.0",
  "method":"window/logMessage",
  "params":{
    "message":"Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.",
    "type":3
  }
}

It sources the elixir sources in /home/runner/work/elixir/elixir but that directory does not exist. That path comes from Enum.module_info()[:compile][:source] which ElixirLS uses to find the elixir sources:

iex> Enum.module_info()[:compile][:source]
~c"/home/runner/work/elixir/elixir/lib/elixir/lib/enum.ex"

I think it is because ASDF installs pre-compiled Elixir :thinking:

Is it somehow possible to use ElixirLS with pre-compiled Elixir? Or is there anything I need to do differently?

I found Issues with ElixirLS: Elixir sources not found and error while running own Elixir LS Version - #2 by jngcorvus but there someone just cloned the elixir sources to that directory, but this feels wrong.

First Post!

lukaszsamson

lukaszsamson

ElixirLS Core Team

That’s a known issue. There was a PR to elixir_sense that added support for custom path to sources but it would need a similar setting and integration on ElixirLS side. Another option would be to return an URI to github source code. Either way, it’s not high on my priority list as I build elixir from sources and navigation to stdlib works correctly on my env.

Most Liked

ataraxian_dax

ataraxian_dax

I chased this issue down for over a week and the solution ended up being an unknown VSCode issue. I had been logged in to VSCode and using Setting Sync so I had many settings and extensions from over the years and I decided to just nuke VSCode and start from scratch. Once removed VSCode and all its associated files and re-installed I downloaded Elixir-LS so it was the only extension I had installed. I ran VSCode from my repo in the terminal and Elixir-LS started compiling my app successfully and once it finished I had full functionality.

Where Next?

Popular in Questions Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
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
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54260 488
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
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
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement