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 https://github.com/JakeBecker/vscode-elixir-ls to using https://github.com/elixir-lsp/vscode-elixir-ls

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

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
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
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
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
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
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
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
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
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement