lugomateo
ElixirLS stopped working: "Unable to find formatter"
Not sure what happened, elixirLS had been working just fine in multiple projects.
When I try to format an elixir file on save I get the following…

I tried deleting the .elixir_ls folder to allow ElixirLS to recompile.
I see the following output:
Running /Users/mateo/.vscode/extensions/jakebecker.elixir-ls-0.17.5/elixir-ls-release/launch.sh
Preferred shell is zsh, relaunching
Looking for ASDF install
ASDF install found in /usr/local/opt/asdf/libexec/asdf.sh, sourcing
Installing ElixirLS release v0.17.5
Running in <my project path>
Install complete
[Info - 10:44:33 AM] Started ElixirLS v0.17.5
[Info - 10:44:33 AM] Running in <my project path>
[Info - 10:44:33 AM] ElixirLS built with elixir "1.14.2" on OTP "25"
[Info - 10:44:33 AM] Running on elixir "1.14.2 (compiled with Erlang/OTP 25)" on OTP "25"
[Info - 10:44:33 AM] Protocols are not consolidated
[Info - 10:44:33 AM] Elixir sources not found (checking in /home/build/elixir). Code navigation to Elixir modules disabled.
[Info - 10:44:33 AM] Received client configuration via workspace/configuration
%{"additionalWatchedExtensions" => [], "autoBuild" => true, "autoInsertRequiredAlias" => true, "dialyzerEnabled" => true, "dialyzerFormat" => "dialyxir_long", "dialyzerWarnOpts" => [], "enableTestLenses" => false, "envVariables" => %{}, "fetchDeps" => false, "languageServerOverridePath" => "", "mixEnv" => "test", "mixTarget" => "", "projectDir" => "", "signatureAfterComplete" => true, "suggestSpecs" => true, "trace" => %{"server" => "off"}}
[Info - 10:44:33 AM] Loaded DETS databases in 92ms
[Info - 10:44:33 AM] Registering for workspace/didChangeConfiguration notifications
[Info - 10:44:33 AM] client/registerCapability succeeded
[Info - 10:44:33 AM] Registering for workspace/didChangeWatchedFiles notifications
[Info - 10:44:33 AM] client/registerCapability succeeded
[Info - 10:44:33 AM] Starting build with MIX_ENV: test MIX_TARGET: host
[Info - 10:44:34 AM] Compile took 490 milliseconds
[Info - 10:44:34 AM] [ElixirLS WorkspaceSymbols] Indexing...
[Info - 10:44:34 AM] [ElixirLS WorkspaceSymbols] Module discovery complete
[Info - 10:44:34 AM] [ElixirLS WorkspaceSymbols] 24 callbacks added to index
[Info - 10:44:35 AM] [ElixirLS WorkspaceSymbols] 247 modules added to index
[Info - 10:44:36 AM] [ElixirLS WorkspaceSymbols] 422 types added to index
[Info - 10:44:37 AM] [ElixirLS WorkspaceSymbols] 4868 functions added to index
Then nothing else happens…
And when I try to format on save I see
[Error - 10:44:52 AM] Request textDocument/formatting failed.
Message: project_not_loaded
Code: -32603
Also, I dont ever see a build folder get created in .elixir_ls or any dyalizer_tpm folder for that matter.
Any ideas?
Most Liked
lukaszsamson
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
cgraham
Just adding in I had this for weeks on latest version of ElixirLS (0.23.1). Elixir 1.17.2, OTP 27. Tried installing older versions, uninstalling, reinstalling. Nothing worked. Eventually I uninstalled, trashed the .elixir_ls folder, reinstalled an older version and then upgraded Elixir LS and it worked!
7stud
I was getting the “Unable to find formatter” error in an umbrella app (auction_umbrella in “Elixir in Action 1.4”), but I really didn’t care if my code was formatted according to some spec. However, when I opened a terminal window in vscode, that blasted error message would popup and cover the output in the terminal window–now the formatter error was a problem! I searched around trying to find a solution–without any success, and finally I just unnistalled ElixirLS in vscode, quit vscode, relaunched vscode, and reinstalled ElixirLS in vscode, and now the error is gone. We’ll see if that remains the case.







