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.

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

jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
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
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
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
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
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
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
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
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
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

We're in Beta

About us Mission Statement