<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="307498" data-post-id="307498">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I entertained the idea to move to VIM several times in the last 10-ish years but the script was a turnoff. When nvim with Lua got out it was then I started actually doing it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="307498" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-formatter-in-neovim-using-coc-nvim-sometimes-adds-parenthesis-around-macros/55494/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-307498" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="307498"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="307516" data-post-id="307516">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="elurker" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  elurker
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="elurker" data-post="18" data-topic="55494">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/e/e68b1a/48.png" class="avatar"> elurker:</div>
<blockquote>
<p>tried that, and when I save a child <code>router.ex</code> for example, <code>elixirls</code> flashes an error saying something like <code>Unable to find formatter for</code></p>
</blockquote>
</aside>
<p>Alright, sorry for the noise - as a newcomer I wasn’t aware there’s a dedicated <code>mix new --umbrella</code> (yay!) to set everything up properly. Coming from JS world where I had to set up monorepos manually, but here it’s turn-key. Now formatting seems to work fine, without any custom NeoVim or LS configuration.</p>
<p>(I should note that I still get the error from above if I try to save an Elixir file without giving ElixirLS a few seconds to start up, if I close and reopen Neovim. But that’s probably expected)</p>
<p>Thanks again for all your help!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="307516" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-formatter-in-neovim-using-coc-nvim-sometimes-adds-parenthesis-around-macros/55494/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-307516" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="307516"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="326043" data-post-id="326043">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>And now I have the opposite problem: I want the formatter to automatically add parentheses to all function calls in the <code>priv/repo/migrations/</code> directory but after trying for 5 minutes I gave up.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326043" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-formatter-in-neovim-using-coc-nvim-sometimes-adds-parenthesis-around-macros/55494/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-326043" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326043"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="326102" data-post-id="326102">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Got annoyed and decided to pursue. I really want parentheses in my <code>ecto</code> and <code>ecto_sql</code> code.</p>
<p>TL;DR: I had this file in my project: <code>priv/repo/migrations/.formatter.exs</code>. I also have the <code>.formatter.exs</code> in the root of the project. I removed the first file and removed <code>:ecto</code> and <code>:ecto_sql</code> from <code>import_deps</code> in my root <code>.formatter.exs</code> file, then did <code>rm -rf _build &amp;&amp; mix do deps.get, compile</code> and <em>et voila</em>, both <code>mix format</code> and ElixirLS started adding parentheses in my migrations code.</p>
<hr>
<p>Long version:</p>
<p><code>priv/repo/migrations/.formatter.exs</code> had these contents:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[
   import_deps: [:ecto_sql],
   inputs: ["*.exs"]
]
</code></pre>
<p><code>.formatter.exs</code> (at the root of the project) had these contents:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[
  import_deps: [:ecto, :ecto_sql, :phoenix],
  subdirectories: ["priv/*/migrations"],
  plugins: [Phoenix.LiveView.HTMLFormatter],
  inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/**/*.exs"]
]
</code></pre>
<p>When I tried desperately to manually <code>mix format</code> my migrations to put parentheses in (I dislike the space syntax and prefer the parentheses <img src="https://forum.elixirforum.com/images/emoji/apple/person_shrugging.png?v=15" title=":person_shrugging:" class="emoji" alt=":person_shrugging:" loading="lazy" width="20" height="20">), I got this error (I have replaced the absolute path on my storage with $STORAGE_PATH):</p>
<blockquote>
<p>Both .formatter.exs and $PROJECT_PATH/priv/repo/migrations/.formatter.exs specify the file $PROJECT/priv/repo/migrations/20240229041210_add_oban_jobs_table.exs in their :inputs option. To resolve the conflict, the configuration in .formatter.exs will be ignored. Please change the list of :inputs in one of the formatter files so only one of them matches $PROJECT_PATH/priv/repo/migrations/20240229041210_add_oban_jobs_table.exs</p>
</blockquote>
<p>So I:</p>
<ol>
<li>Removed <code>priv/repo/migrations/.formatter.exs</code>;</li>
<li>Edited the root <code>.formatter.exs</code> file like so (removed <code>ecto</code> and <code>ecto_sql</code> from <code>import_deps</code>):</li>
</ol>
<pre data-code-wrap="diff"><code class="lang-diff">[
-  import_deps: [:ecto, :ecto_sql, :phoenix],
+  import_deps: [:phoenix],
  subdirectories: ["priv/*/migrations"],
  plugins: [Phoenix.LiveView.HTMLFormatter],
  inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/**/*.exs"]
]
</code></pre>
<ol start="3">
<li>Removed the <code>_build</code> directory (<code>rm -rf _build</code>) and then ran <code>mix do deps.get, compile</code>. Note that without this step formatting still didn’t work like I wanted it to.</li>
</ol>
<p><code>mix format</code> worked immediately after – as in, it added parentheses where there were none.</p>
<p>ElixirLS worked immediately after as well.</p>
<p>Mystery solved. No idea what possessed me to make this secondary <code>.formatter.exs</code> file inside the <code>priv/repo/migrations/</code> directory.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326102" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-formatter-in-neovim-using-coc-nvim-sometimes-adds-parenthesis-around-macros/55494/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-326102" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326102"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="326111" data-post-id="326111">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="arcanemachine" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/arcanemachine/120/29109_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  arcanemachine
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>No idea what possessed me to make this secondary <code>.formatter.exs</code> file inside the <code>priv/repo/migrations/</code> directory.</p>
</blockquote>
<p>The generator puts it there when creating the project:</p>
<p><a href="https://github.com/arcanemachine/phx-new/blob/master/priv/repo/migrations/.formatter.exs" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/arcanemachine/phx-new/blob/master/priv/repo/migrations/.formatter.exs</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326111" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-formatter-in-neovim-using-coc-nvim-sometimes-adds-parenthesis-around-macros/55494/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-326111" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326111"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="339586" data-post-id="339586">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="miguno" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/miguno/120/36857_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  miguno
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for this write-up, <a class="mention" href="/u/dimitarvp" rel="nofollow">@dimitarvp</a>. I had a very similar issue, for which <code>rm priv/repo/migrations/.formatter.exs</code> was the solution.</p>
<p>FWIW, my error was:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[ERROR] Formatter 'mix' error: ** (Mix) Unknown dependency :ecto_sql given to :import_deps in the formatter configuration. Make sure the dependency is listed in your mix.exs for environment :dev and you have run "mix deps.get"
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="339586" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-formatter-in-neovim-using-coc-nvim-sometimes-adds-parenthesis-around-macros/55494/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-339586" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="339586"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="339588" data-post-id="339588">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="miguno" data-post="27" data-topic="55494">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/miguno/48/36857_2.png" class="avatar"> miguno:</div>
<blockquote>
<p>I had a very similar issue, for which <code>rm priv/repo/migrations/.formatter.exs</code> was the solution.</p>
</blockquote>
</aside>
<p>One of my steps was removing that file as well.</p>
<p>Welcome to the forum. <img src="https://forum.elixirforum.com/uploads/default/original/2X/c/c230ac0d02119e7fcb5e0a23bc2a5354d3d47789.gif?v=15" title=":058:" class="emoji emoji-custom" alt=":058:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="339588" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-formatter-in-neovim-using-coc-nvim-sometimes-adds-parenthesis-around-macros/55494/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-339588" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="339588"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>