Open fschuindt opened 3 weeks ago
There is some problem with your env. The functions are definitely defined, see build on elixir 1.16 and OTP 25 https://github.com/elixir-lsp/elixir-ls/actions/runs/9461131788/job/26067861648. The fact that it's crashing like that means that there is a problem earlier with either your shims, elixir, OTP, ElixirLS install or mix cache. This is a giveway:
I have tried it, but I wasn't able to make VSCode to identify my Elixir installation
Some troubleshooting you should try
Mix.Utils.mix_cache()
returns on your machine)/path/to/elixir-ls/language_server.sh
You haven't posted the most important logs from ElixirLS start and install
Are you talking about the logs during the starting of the LS? Like so?
How did you install ElixirLS
git checkout v0.22.0
mix deps.get
MIX_ENV=prod mix compile
MIX_ENV=prod mix elixir_ls.release2 -o ./rel/
Please make sure that your shims are correct and VSCode is able to pick them up. It's a common problem on linux
This is the most tricky part for me, I have very little experience with VSCode. The elixir
command is available all through my machine, never faced problems with it. I've checked: .bashrc
, .bash_profile
, .zshrc
, .zprofile
and .profile
, they all seem correct.
If I open VSCode from my program launcher, it will complain about not finding the elixir
command:
I just discovered that, if I cd
into the repository and run code .
, Elixir and the LSP works fine, this is for the 1.14.3 project:
And this is for the 1.16.3 project:
I think that confirms that this is not a bug within the ElixirLS project, so feel free to close my issue. However I'm still clueless on what to do next. Any tips?
Delete mix cache directories (whatever Mix.Utils.mix_cache() returns on your machine)
Done. No noticeable effect.
You should be able to start ElixirLS from shell when you cd to your project dir with /path/to/elixir-ls/language_server.sh
This is cool. I did that to get the starting logs on the different versions I just posted here. Any way to make the editor to use this process instead? Just so I can monitor logs more closely. (Not important)
Precheck
Done. Nothing relevant.
I have started a small thread on the Elixir's Slack, but I'm starting to think this might be indeed a bug.
I have tried it, but I wasn't able to make VSCode to identify my Elixir installation. However, I think my description will clarify that this might be related to the version of Elixir, as it works when using other versions.
Environment
Current behavior
If I create a Mix project using Elixir 1.16, the LSP stops working as expected and whenever there's an issue on the code, it starts acting like crashing. It works normally if I use Elixir 1.14. Since on the README.md the 1.16 is listed as fully supported, I figured I would open this.
Using Elixir 1.16
asdf global elixir 1.16.3-otp-25
mix new test_1_16_3 --module Test
mix.exs
, LSP complains about exception being raised.hello.ex
file, and introduce a syntax problem, LSP crashes.Relevant LSP logs:
Complete log here.
Picture:
Expected behavior
Using Elixir 1.14 yields the expected behavior.
Using Elixir 1.14
asdf global elixir 1.14.3-otp-25
mix new test_1_14_3 --module Test
mix.exs
, LSP says it was successfully initiated.hello.ex
file, and introduce a syntax problem, LSP highlights the problem as expected.