VSCodium + ElixirLS - Format on save not working

I’m working on a new project and am having issues with Elixir LS and VSCodium running mix format on saved code.

VSCodium version 1.61.1
Elixir-LS version 0.8.1
Project OTP version: 23.3.4.4
Project Elixir version: 1.12.1

When I save the file nothing happens (no formatting takes place), here is the output from the extension (no errors). I have editor.formatOnSave set to true.

Any ideas on what may be causing this? Thanks!

Started ElixirLS v0.8.1

Elixir version: "1.12.1 (compiled with Erlang/OTP 22)"

Erlang version: "23"

ElixirLS compiled with Elixir 1.10.4 and erlang 22

MIX_ENV: test

MIX_TARGET:

[Info - 2:05:21 PM] Compile took 1858 milliseconds

[Info - 2:05:21 PM] [ElixirLS Dialyzer] Checking for stale beam files

[Info - 2:05:21 PM] [ElixirLS WorkspaceSymbols] Indexing...

[Info - 2:05:21 PM] [ElixirLS WorkspaceSymbols] Module discovery complete

[Info - 2:05:21 PM] [ElixirLS WorkspaceSymbols] 22 callbacks added to index

[Info - 2:05:21 PM] [ElixirLS Dialyzer] Found 685 changed files in 133 milliseconds

[Info - 2:05:21 PM] [ElixirLS Dialyzer] Analyzing 0 modules: []

[Info - 2:05:21 PM] [ElixirLS Dialyzer] Analysis finished in 99 milliseconds

[Info - 2:05:22 PM] [ElixirLS WorkspaceSymbols] 889 modules added to index

[Info - 2:05:22 PM] Dialyzer analysis is up to date

[Info - 2:05:22 PM] [ElixirLS WorkspaceSymbols] 295 types added to index

[Info - 2:05:23 PM] [ElixirLS Dialyzer] Writing manifest...

[Info - 2:05:24 PM] [ElixirLS Dialyzer] Done writing manifest in 1671 milliseconds.

[Info - 2:05:34 PM] [ElixirLS WorkspaceSymbols] 12190 functions added to index

MIX_ENV: test

MIX_TARGET:

Compiling 2 files (.ex)

[Info - 2:05:44 PM] Compile took 9814 milliseconds

[Info - 2:05:44 PM] [ElixirLS WorkspaceSymbols] Updating index...

MIX_ENV: test

MIX_TARGET:

[Info - 2:05:44 PM] [ElixirLS WorkspaceSymbols] 1 modules need reindexing

[Info - 2:05:44 PM] [ElixirLS WorkspaceSymbols] 0 callbacks added to index

[Info - 2:05:44 PM] [ElixirLS WorkspaceSymbols] 0 types added to index

[Info - 2:05:44 PM] [ElixirLS WorkspaceSymbols] 1 modules added to index

[Info - 2:05:44 PM] [ElixirLS WorkspaceSymbols] 6 functions added to index

Compiling 2 files (.ex)

[Info - 2:05:54 PM] Compile took 9573 milliseconds

[Info - 2:05:54 PM] [ElixirLS Dialyzer] Checking for stale beam files

[Info - 2:05:54 PM] [ElixirLS Dialyzer] Found 685 changed files in 62 milliseconds

[Info - 2:05:54 PM] [ElixirLS Dialyzer] Analyzing 0 modules: []

[Info - 2:05:54 PM] [ElixirLS Dialyzer] Analysis finished in 35 milliseconds

[Info - 2:05:54 PM] Dialyzer analysis is up to date

[Info - 2:05:55 PM] [ElixirLS Dialyzer] Writing manifest...

[Info - 2:05:56 PM] [ElixirLS Dialyzer] Done writing manifest in 1416 milliseconds.
1 Like

I also went through the debugging steps listed on the ElixirLS GH page, nothing helped.

Does it format if you manually run “Format Document” from the command menu? And are there any errors in the developer tools (Help → Toggle Developer Tools)?

Also in your ElixirLS settings can you set “Elixir LS › Trace: Server” to messages or verbose and post the results after saving or manually formatting.

I don’t know how to say this, but when I went back to VSCodium to retrieve what you asked for, formatting on-save worked. I appreciate your replies, thank you!

1 Like

Okay, well I’m glad it’s working now!