torrocar

torrocar

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!

Showing Posts 1 to 10

TunkShif

TunkShif

Which Erlang/OTP version are you using? elixir-ls seems not working properly with OTP 26 from my test. Try downgrade to OTP 25 and recompile elixir-ls.

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.

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.

torrocar

torrocar OP

Thank you for your quick responses!
Indeed I have updated all packages to their newest versions and OTP is installed as v26 via the Erlang package, so that may well be the problem.
I’ll go get asdf and report back if that solves the issue.

linusdm

linusdm

Just out of curiosity: how do you compile elixir-ls locally and make it play nice with the Mason plugin that’s managing lsp’s for lunarvim?

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.

linusdm

linusdm

Oh, that’s a nice way to go about it! Thx for sharing. Does that still keep all the keybindings in place that lunarvim provides? And does Mason still work for other lsp’s? I’ll definitely will try it.

My method was finding out where mason puts the installed lsp (somewhere in a shared directory, specifically for lvim), and then make the release output in that directory (using the -o flag of mix release). But that didn’t feel right. I’m also not using the bleeding edge, like you do every 24 hours.

dimitarvp

dimitarvp

I don’t use all of them but those that I use: yes, they still work.

Yep. You can override each separate LSP without affecting anything else.

torrocar

torrocar OP

Yes, downgrading to OTP 25 did the trick!
In the process I learned about using the asdf version manager, which now is a new addition to my toolbox.
Thanks again to all who took their time to answer to this thread!

dimitarvp

dimitarvp

Or you can use rtx, something I just replaced asdf with today. :003:

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews