bitboxer

bitboxer

VSCode formatter

I was happily using VSCode for the last 1 1/2 years and wrote tons of elixir in it, but somehow in the last couple of weeks something broke the code formater plugin that i was using. I tried two others, but they all do not work anymore. I have not enough knowledge to understand what is happening, and because of that I am asking here first: is this just my computer? Or have others seen this problem, too? What formater plugin do you use? If this is just me I will have to start to learn how to debug it…or switch back to vim :lol:.

Marked As Solved

bglusman

bglusman

@bitboxer I use VSCode and switched a few months ago from using GitHub - JakeBecker/vscode-elixir-ls: Elixir language support and debugger for VS Code, powered by ElixirLS. · GitHub to using GitHub - elixir-lsp/vscode-elixir-ls: Elixir language support and debugger for VS Code, powered by ElixirLS. · GitHub

Both of them though enable mix.format on save, if you set this config in your settings.json:

"[elixir]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "elixir-lsp.elixir-ls"
}

I do have persistent odd breakage in formatting though, where at irregular intervals I notice it’s no longer formatting on save, but if I quit VSCode and restart it works again. If anyone has a fix/diagnosis on that I’d love it, mostly because I don’t always notice for a while and occasionally commit unformatted code as a result. It also seems to take a minute or so after restarting to respect the rules for .formatter.exs re: locals_without_parens which often leads to a bunch of changes that I don’t want.

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
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
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
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
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
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
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
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
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
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
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
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
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
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement