diff options
-rw-r--r-- | ftplugin/elixir.lua | 15 | ||||
-rw-r--r-- | lua/default-config.lua | 8 |
2 files changed, 22 insertions, 1 deletions
diff --git a/ftplugin/elixir.lua b/ftplugin/elixir.lua index f3869ee5..4d6a3e6d 100644 --- a/ftplugin/elixir.lua +++ b/ftplugin/elixir.lua @@ -2,6 +2,21 @@ if require("lv-utils").check_lsp_client_active "elixirls" then return end +O.formatters.filetype["elixir"] = { + function() + return { + exe = O.lang.elixir.formatter.exe, + args = O.lang.elixir.formatter.args, + stdin = not (O.lang.elixir.formatter.stdin ~= nil), + } + end, +} + +require("formatter.config").set_defaults { + logging = false, + filetype = O.formatters.filetype, +} + require("lspconfig").elixirls.setup { cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh" }, } diff --git a/lua/default-config.lua b/lua/default-config.lua index 4f7eb045..78d33fad 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -123,7 +123,13 @@ O = { efm = {}, elm = {}, emmet = { active = false }, - elixir = {}, + elixir = { + formatter = { + exe = "mix", + args = { "format" }, + stdin = true, + }, + }, graphql = {}, go = { formatter = { |