popo63301
VSCode Elixir Format - Prevent auto parentheses
Hello !
I would like to prevent automatic parentheses while coding in Elixir in VSCode.
I can’t see where to configure that.
Any suggestions ?
Most Liked
cmo
The elixir formatter doesn’t have much in the way of options. The idea is that you accept how it is and move on with your life, free from worrying about formatting.
There are libraries, ecto, phoenix etc, that tell it not to add them to some macros, which you need to add to formatter.exs.
If you’re just talking about it creating the second bracket, look in the VS Code settings.
popo63301
I have to precise. It’s annoying for 2 particular situations:
Macros like add and field (in Ecto Migrations and Schemas)
cmo
Have you got the inpit_deps set in .formatter.exs? The ecto setting should stop that. However, as someone pointed out, it will randomly screw it up every now and then. You have git to save you in those instances.
[
import_deps: [:ecto, :phoenix, :surface, :nimble_parsec],
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs,sface}"],
subdirectories: ["priv/*/migrations"],
...
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








