Hi, I am getting the same notification when working on exs files for a course. I have not created a mix project and until recently I was able to use the formatter without issues. I figured out that version v0.17.4 of the elixirLS plugin introduced this bug and shows this error message when reformatting a file.
Do you open single exs scripts or open a directory without mix project? In both scenarios the formatting should work and rely on default formatter settings. For mix project it loads the project and gets formatter options from .formatter.exs
I am having the exact same issue on a brand new Mix project, which is a very simple one. ElixirLS isn’t finding a formatter, and then it also crashes and doesn’t work at all beyond syntax highlighting. I just get this message in the Output tab:
[Error - 12:44:13 AM] Stopping server failed
Error: Stopping the server timed out
at c:\Users\<username>\.vscode\extensions\jakebecker.elixir-ls-0.17.6\out\extension.js:89:9067
Edit: This is clear from the file path reported, but this is on Windows 11. Also, mix compile, mix format, etc. work fine.
I haven’t used Elixir in a few months, so I don’t know when this began. But this is a fresh Mix project with the latest Elixir (Elixir 1.15.7 / OTP 26) on Windows 11. I haven’t tried yet on Ubuntu through WSL. There’s nothing special going on in the Mix project.
hi @lukaszsamson
I am unable to create a new repo that reproduces the problem. I should mention that all my other elixir repos can run ElixirLS successfully (except for one, totaling 2 repos that don’t work). I cannot discern significant differences between them that would hint at the problem currently.
But I am able to get ElixirLS to work on both repos when I lower the version to 0.17.3 !!!
Anything beyond that does not work.
I can reproduce your crash on windows only. The repo works fine on macos. The language server is not crashing, it’s vscode that closes the connection. It looks like another wonderful case od OTP 26 breaking basic stdio like other ones in Not starting on OTP26 · Issue #886 · elixir-lsp/elixir-ls · GitHub
Thanks for diving in and figuring it out, especially so quickly! Too bad the issue is in OTP itself.
It sounds like if I roll back to using OTP 25 that everything should be working? That’s easy enough for me to do since I’m not using any OTP 26 specific features, that I know of, in any projects at the moment.
I haven’t tested on OTP 25. I opened Crash on windows OTP 26 · Issue #1023 · elixir-lsp/elixir-ls · GitHub for tracking. It seems the issue is caused by message truncation. It can be triggered with completion on empty string when there’s many options. Completions starting from some prefix work fine
Also, I rolled back to OTP 25, and everything seems to be working again as expected. So that’s good that it seems to be only in OTP 26, for Windows at least.
The culprit was on my end. The LS wasn’t able to build due to dependency conflicts in my umbrella application and was resulting in the same “Unable to find formatter” error. Apologies for the unrelated alarm. Though the symptoms were the same