lugomateo

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

lukaszsamson

ElixirLS Core Team

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

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

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.

Last Post!

marcandre

marcandre

Thank you. I’m not sure what happened, I had given up and didn’t do anything else, but at some point the formatter started working again. So it looks like the procedure worked, but maybe it took a while for the tools/cache to build in the background so I didn’t detect it working :thinking:

Thanks to all

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Lily
In templates/appointment/index.html.eex: &lt;%= for appointment &lt;- @appointments do %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= appoi...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
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