As you can see, for golang I am using efm only for lint, the rest I do using gopls; There is a problem though, for typescript I am using prettier for formating, so I need to set init_options = {documentFormatting = true} and I have a format command set on save. For typescript it is ok, but for go, I have 2 server which offer documentFormating, so everytime I save a document I need to select the LSP I want to use for formatting. In this case my EFM don't format for Go so it is useless and inconvenient. I wonder if it is possible to do something like:
local prettier = {
formatCommand = 'prettier'
init_options = {documentFormatting = true}, -- SET HERE
}
local golangcilint = {
lintCommand = "golangci-lint run",
lintSource = "golanci-lint",
init_options = {documentFormatting = false}, -- SET HERE
}
lsp.efm.setup{
root_dir = vim.loop.cwd,
settings = {
rootMarkers = {".git/"},
languages = {
go = {golangcilint},
typescript = {prettier},
}
}
}
Hello, I am using efm-langserver with
nvim-lspconfig
, this is my configuration:As you can see, for golang I am using efm only for lint, the rest I do using
gopls
; There is a problem though, for typescript I am using prettier for formating, so I need to setinit_options = {documentFormatting = true}
and I have a format command set on save. For typescript it is ok, but for go, I have 2 server which offer documentFormating, so everytime I save a document I need to select the LSP I want to use for formatting. In this case my EFM don't format for Go so it is useless and inconvenient. I wonder if it is possible to do something like: