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

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
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