# Disable formatting on Erlang\_LS

**URL:** <https://erlangforums.com/t/disable-formatting-on-erlang-ls/2601>\
**Category:** Questions / Help\
**Tags:** code-formatters, emacs, erlang\_ls, lsp\
**Created:** [May 12, 2023, 12:47pm UTC](https://erlangforums.com/t/disable-formatting-on-erlang-ls/2601 "2023-05-12T12:47:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin-Philip](https://erlangforums.com/user_avatar/erlangforums.com/benjamin-philip/32/2387_2.png) [@Benjamin-Philip](https://erlangforums.com/u/Benjamin-Philip)\
**Post date:** [May 12, 2023, 12:47pm UTC](https://erlangforums.com/t/disable-formatting-on-erlang-ls/2601/1 "2023-05-12T12:47:19Z")

</div>

I recently started using Erlang\_LS with Emacs and Eglot. Whenever I save, my file is auto formatted (I’ve got `format-all-mode` setup) by Erlang\_LS through Eglot. However, I prefer to use `erlfmt` via `rebar3 fmt` and also the formatting with erlang\_ls is destructive sometimes, and my code won’t compile post formatting. Is there some configuration in `erlang_ls.config` to disable formatting so that it won’t format on save or on `M-x eglot-format`?

Now the ideal solution is to disable it through Emacs, but I need to go through `format-all-mode` and `eglot`’s source code as there isn’t documentation on not formatting/blacklisting a certain language. So I’m look for a temporary fix here till I have the time to write some Elisp.

---

<div class="post-metadata">

**Author:** ![williamthome](https://erlangforums.com/user_avatar/erlangforums.com/williamthome/32/471_2.png) [@williamthome](https://erlangforums.com/u/williamthome)\
**Post date:** [May 12, 2023, 1:13pm UTC](https://erlangforums.com/t/disable-formatting-on-erlang-ls/2601/2 "2023-05-12T13:13:14Z")

</div>

Yes, there is.  
Add this to your `erlang_ls.config`:

```erlang
providers:
  disabled:
    - document-formatting

```

Check out this [example](https://github.com/williamthome/eel/blob/feat/new_strategy/erlang_ls.config).  
See also the `Erlang LS` [configuration docs](https://erlang-ls.github.io/configuration/).

---

<div class="post-metadata">

**Author:** ![delitrem](https://erlangforums.com/user_avatar/erlangforums.com/delitrem/32/2429_2.png) [@delitrem](https://erlangforums.com/u/delitrem)\
**Post date:** [July 6, 2024, 6:42pm UTC](https://erlangforums.com/t/disable-formatting-on-erlang-ls/2601/3 "2024-07-06T18:42:47Z")

</div>

> [@Benjamin-Philip](#):
>
> also the formatting with erlang\_ls is destructive sometimes, and my code won’t compile post formatting

Does anybody experience the same behaviour with eglot?
