torrocar

torrocar

Elixir-LS fails in neovim

Hi all,

I have configured my neovim according to this thread - thanks for the awesome work on that one, btw!
As I am working on an Arch-based Linux system (Artix, to be precise), I had installed the language server from the AUR, where the package version 0.13.0 worked nicely.
However, after upgrading to package version 0.14.6, every time I open an elixir file I’ll get the message Client 1 quit with exit code 1 and signal 0 after a few seconds. Restarting the server with :LspStart will result in the same message.
I have tried installing elixir-ls via mason as well, which will display the same error. Downgrading to v013.0, which worked formerly, also doesn’t help.
I even created a new user, set up neovim from scratch for him, and ran into the same problem. This is also true when I use the exact init.lua-file given in the tutorial - with the path to elixir-ls set correctly, of course.

Checking the lsp.log reveals the following error, which unfortunately I can’t make much of:

[START][2023-06-15 13:47:58] LSP logging initiated
[ERROR][2023-06-15 13:47:58] .../vim/lsp/rpc.lua:734	"rpc"	"/home/torro/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"Runtime terminating during boot ({badarg,[{io,put_chars,[standard_err"
[ERROR][2023-06-15 13:47:58] .../vim/lsp/rpc.lua:734	"rpc"	"/home/torro/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"or,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})\r\n"
[ERROR][2023-06-15 13:47:58] .../vim/lsp/rpc.lua:734	"rpc"	"/home/torro/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"\r\nCrash dump is being written to: erl_crash.dump..."
[ERROR][2023-06-15 13:47:59] .../vim/lsp/rpc.lua:734	"rpc"	"/home/torro/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"done\r\n"

I’d appreciate any help or pointers where to continue searching a solution!

Thank you for your trouble!

Marked As Solved

TunkShif

TunkShif

BTW, I’m an ArchLinux user, too. The erlang package from arch official repo has been updated to 26 recently. If you’re using pacman to update all software packages to the latest version, including erlang, then it can break elixir-ls. I’ve encountered the same issue a few days ago. I’d recommend you use asdf to manage different erlang/elixir versions. You can install it from AUR under the asdf-vm package name.

Also Liked

lukaszsamson

lukaszsamson

ElixirLS Core Team

ElixirLS 0.15.1 with support for OTP 26.0.2+ is out

dimitarvp

dimitarvp

I am using Elixir 1.14.5 and Erlang 25.3.2.2 and compiling ElixirLS locally with those versions, I use LunarVim with it and have no problems.

I am not keeping up super closely with all the developments but I am seeing increased reports on the forum that people have issues with Erlang/OTP 26 so I’d hold on to 25 for the time being.

dimitarvp

dimitarvp

I don’t use Mason’s installed ElixirLS. I have it locally and update it from GitHub once every 24h and build it like so (this is a snippet from my own homemade “update my machine” script, hence the pushd and popd commands):

(
  pushd ~/bin/elixir-ls &&
  git reset --hard HEAD &&
  git pull &&
  mix deps.get &&
  MIX_ENV=prod mix compile
  MIX_ENV=prod mix elixir_ls.release &&
  popd || return
)

I also make sure it uses the latest stable combo of Elixir and Erlang. I use asdf local for that, though maybe that’s not optimal.

Then I have this in my LunarVim’s init file:

local root_pattern = require("lspconfig").util.root_pattern

require 'lspconfig'.elixirls.setup {
  filetypes = { "elixir", "eelixir", "heex", "surface" },
  root_dir = root_pattern("mix.exs", ".git") or vim.loop.os_homedir(),
  cmd = { "/Users/dimi/bin/elixir-ls/release/language_server.sh" },
}

Though I should probably take another look at the filetypes.

Last Post!

lukaszsamson

lukaszsamson

ElixirLS Core Team

ElixirLS 0.15.1 with support for OTP 26.0.2+ is out

Where Next?

Popular in Questions Top

RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
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
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
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
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
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

Other popular topics 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
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40042 209
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