Open collegeimprovements opened 3 years ago
Sorry, I don't use neovim. Anyone, please help this.
Incredibly, this is simple and silly to solve I don't program in elixir, but I was able to test if the formatter was working. Just add an - at the end of the command, and it will work
---------------------------------------------
-- efm-langserver | General purpose LSP --
---------------------------------------------
-- efm-langserver language modules--
-- mixformat | testing only --
local mixformat = {
formatCommand = 'mix format -',
formatStdin = true
}
-- efm-langserver languages settings --
local efm_languages = {
elixir = { mixformat }
}
-- Filetypes supported --
local efm_filetypes = {"elixir"}
local home = os.getenv("HOME")
-- efm-langserver Settings --
lspconfig.efm.setup{
cmd = {'efm-langserver', '-logfile', home..'/.config/efm-langserver/efm.log', '-loglevel', '10'},
filetypes = efm_filetypes,
on_attach = on_attach,
init_options = {documentFormatting = true},
root_dir = function() return vim.fn.getcwd() end;
settings = {
rootMarkers = {".git/", vim.fn.getcwd()},
languages = efm_languages
}
}
Your format-command is "mix format" without the - at the end The correct is "mix format -" with - in the end.
According to what is in the documentation, the - is used to read output from stdin and write to stdout Docs at GitHub HexDocs reference
Thanks a lot for this awesome plugin.
I'm trying to format
elixir
files with, the following config.But it doesn't seem to work.
Here is the relevant config from
init.lua
file:However it's not working for elixir file but does work for lua files. Please help.