Haogudu
Problem with formatting elixir in vs code
Hello, I just started to learn elixir by following Alchemist Camp’s tutorial. And I had problem with formatting my code in vs code editor. I tried multiple formatter extensions. None of them worked for me. And the editor ran into compatibility problem. So, I deleted all the elixir related extension except ElixirLS. The editor finally stop giving me error. But it did not format my code either. Then I checked the “settings.json” file and updated the Elixir part as following:
“[elixir]”: {
“editor.defaultFormatter”: “JakeBecker.elixir-ls”
}
I tried to format it again after I reload vs code. It is not working still. Can someone help me with the format setting?
Most Liked
KristerV
i actually haven’t been able to get any formatters to work properly. so i made a “stupid” solution.
I use the Run on Save extension to run mix format as it would in Bash (CLI). then all you need to do is make sure mix format actually works by using it in Bash.
benwilson512
Hi @Haogudu I believe you are not configuring the right extension. You should be using GitHub - elixir-lsp/elixir-ls: A frontend-independent IDE "smartness" server for Elixir. Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol" · GitHub. The JackeBecker.elixir-ls is not the one to use.
lukaszsamson
This is incorrect. The vscode extension is still using the original name. Unfortunately it’s not possible to rename a published extension. This is still a correct formatter config for ElixirLS config
"[elixir]": {
"editor.defaultFormatter": "JakeBecker.elixir-ls"
}
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








