LSP-Elixir continuously crashing

I’ve been trying to get my Elixir setup working but LSP-Elixir consistently crashes. I’ve tried removing it, and all other Elixir packages and reinstalling them but it always ends up crashing.

Screen Shot 2023-04-21 at 8.49.53 AM

This is the message from the console:

Traceback (most recent call last):
  File "/Users/travis/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 181, in invoke
  File "/Users/travis/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/sessions.py", line 1962, in on_transport_close
  File "/Users/travis/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/windows.py", line 395, in on_post_exit_async
  File "./python3.3/_weakrefset.py", line 60, in __iter__
RuntimeError: Set changed size during iteration

I have the latest version of Sublime. Installed LSP and Elixir Sublime Syntax.

Any suggestions?

1 Like

Just noticed somebody liked this so I’m going to provide a brief update.
Unfortunately, I can’t remember all the steps I went through to get this working (I was working through a few disparate issues at the time and I’ve since switched machines) but I believe it had to do with my ASDF path where the Elixir LS was vs where the Sublime plugin was looking.

I’m linking to a related, but different, issue I had about the auto-format on save for lsp-elixir and the elixir sublime syntax, princemaple and azizk had some really good tips for troubleshooting which may prove helpful.

1 Like

I am experimenting this exact error right now.
How do you guys managed to fix it?
Also, I am open to text editor recommendations.
Thanks!

Hey @calebjosue I’m still not 100% sure how I fixed this it was over a year ago now and I walked a winding path before I found a solution. I was using an Elixir formatter (not the Sublime LSP) and mix format was not working on save so I had an open issue for a while: Will not format- (Mix) Could not find an SCM for dependency :credo · Issue #56 · elixir-editors/elixir-sublime-syntax · GitHub. I still go back to that because some of the info I got from the maintainers of that package was very helpful and step by step we were able to fix my issue.

For what it’s worth I’m looking at my LPS.sublime-settings file and the elixir setup is fairly simple:

  "lsp_format_on_save": true,
  "command": ["elixir-ls"],
  "enabled": true,

I’m using ASDF, asdf where elixir is in the standard directory: /Users/travis/.asdf/installs/elixir/1.13. Admittedly, I still sometimes encounter small issues like documentation not showing up but for the most part its working for me.

Thanks!
I think I am going to give nvim a try.

It took me a while to make this work for me. It seems that debugger adapter doesn’t work on nvim, also I have quite a long way to go to see how this integrates with Phoenix applications.

In the case you are totally new at customizing nvim you may find the following content useful:
elixirlsnvim

Thanks fellows!