fix(erlang): formatter command

Close: #8506
Co-authored-by: apostaat <apostaat@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2025-12-29 19:32:20 -05:00
parent 04b7490dec
commit 96498a9859
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 4 additions and 2 deletions

View file

@ -5,7 +5,7 @@
:mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode)
:mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode)
:config
(set-formatter! 'erlfmt '("rebar3" "fmt" "-")
(set-formatter! 'erlfmt '("rebar3" "format")
:modes '(erlang-mode erlang-ts-mode))
(when (modulep! +lsp)
(add-hook 'erlang-mode-local-vars-hook #'lsp! 'append)))

View file

@ -10,5 +10,7 @@
"This module requires (:tools tree-sitter)")
(when (modulep! :editor format)
(unless (and (executable-find "rebar3") (zerop (car (doom-call-process "rebar3" "fmt" "-v"))))
(if (executable-find "rebar3")
(unless (zerop (car (doom-call-process "rebar3" "format")))
(warn! "Couldn't find rebar3 with format plugin installed. Formatting will be disabled."))
(warn! "Couldn't find erlfmt. Formatting will be disabled.")))