Haogudu

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

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

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe
lukaszsamson

lukaszsamson

ElixirLS Core Team

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"
  }

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
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
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
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
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
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
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
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
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
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
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
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement