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 ![]()
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 ![]()
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
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
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.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









