marius95

marius95

Issues with ElixirLS: Elixir sources not found and error while running own Elixir LS Version

Hello everyone,

I have two problems with Elixir LS. In the image you can see both problems/questions. I’m using VSCode and the Elixir LS extension. The screenshot is from my Phoenix project. I’ve installed Erlang and Elixir through asdf.

image

Question 1

The last line says: Elixir sources not found and I’m wondering if it is possible to change the path in the info message? I’m not sure why the path is /home/build/elixir.

Question 2

I’m missing some intellisense features in VSCode and I was hoping to solve it with compiling Elixir LS with the same Elixir and Erlang version, I’m using. So I was following this guide: https://dragoshmocrii.com/fix-vscode-elixirls-intellisense-for-code-imported-with-use/?PageSpeed=noscript

The compilation was successful but I get a JsonRPC error while checking the Output Panel of the VSCode console. This error is already mentioned in the trouble shooting page of Elixir LS: GitHub - elixir-lsp/elixir-ls: A frontend-independent IDE "smartness" server for Elixir. Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"

Unfortunately I was unable to find a fix…

Most Liked

dimitarvp

dimitarvp

I still wouldn’t count on that though. No good reason to hold off version upgrades IMO.

lukaszsamson

lukaszsamson

ElixirLS Core Team

languageServerOverridePath may no longer be useful. Since v0.14 the extension uses Mix.install which builds and installs elixirLS using the correct elixir and OTP combo

dimitarvp

dimitarvp

That’s workable. Just delete all build artifacts, stop VSCode (if you are using that then just stop your editor, whichever it is) and start over:

rm -rf .vscode .elixir_ls _build deps
mix do deps.get, compile

Then start your editor again.

inaniyants

inaniyants

for question 2 problem:

Vscode elixir introduced setting languageServerOverridePath. You could find it in vscode settings ElixirLS.
This setting can be configured per workspace, so each project will have its own elixirLS release, which is handy if you’re using asdf for elixir installation and have different elixir versions per project.

Basically, you need to download ElixirLS precompiled release for desired elixir version from here
Releases · elixir-lsp/elixir-ls · GitHub and upzip it to some directory. Then use absolute path to that directory to set languageServerOverridePath setting. Then remove .elixir_ls and _build directories in your project and restart VsCode.
Every time, when vscode elixir ls extension upgrades ElixirLS version, you’ll need to download a new release and repeat all the above.

IMO, it’s better than compiling ElixirLS manually and replacing it in vscode extensions.

dimitarvp

dimitarvp

Elixir 1.11 is still listed as supported here: https://github.com/elixir-lang/elixir/blob/main/lib/elixir/pages/references/compatibility-and-deprecations.md

And you can use it with Erlang 21 to 23.

Where Next?

Popular in Questions Top

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
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

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
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
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
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
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
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
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

We're in Beta

About us Mission Statement